
import { CircleGeometry, Path, Shape, ShapeGeometry, ShapeUtils, Vector2, Vector3 } from "three";
import AModelFmulaUtils from "./AModelFmulaUtils";
import MoldUtils from "./MoldUtils";
import { AK } from "../const/ModelConst";
import { BIM } from "./BIM";
import CommonUtils from "./CommonUtils";

export default class IronUtils {


    static addVectorFaceVI(count: number, vertices: number[], indices: number[], facevec: Vector3[][], fontface: Vector3[]): number {
        // 顶
        vertices.push(fontface[0].x, fontface[0].y, fontface[0].z);
        vertices.push(fontface[1].x, fontface[1].y, fontface[1].z);
        vertices.push(fontface[3].x, fontface[3].y, fontface[3].z);
        vertices.push(fontface[2].x, fontface[2].y, fontface[2].z);

        indices.push(count, count + 2, count + 1);
        indices.push(count + 2, count + 3, count + 1);

        facevec.push([fontface[0], fontface[1], fontface[2], fontface[3]]);
        count += 4;

        return count;
    }


    static getFaceByGeometry(count: number, vertices: number[], indices: number[], facevec: Vector3[][],
        face: Vector3[], geometry: any, fuc: Function): number {

        let position = geometry.attributes.position;
        let index = geometry.getIndex();

        let vertex: any[] = []
        let idxAry: any[] = [];

        for (let i = 0; i < position.array.length; i += 3) {

            let a = position.array[i];
            let b = position.array[i + 1];
            let c = position.array[i + 2];
            let xyz = fuc(a, b);
            vertex.push(xyz[0], xyz[1], xyz[2]);
        }

        // 索引
        for (let i = 0; i < index.array.length; i += 3) {
            let a = index.array[i] + count;
            let b = index.array[i + 1] + count;
            let c = index.array[i + 2] + count;

            idxAry.push(a, b, c);
        }

        vertices.push(...vertex);
        indices.push(...idxAry);
        facevec.push(face);

        count = Math.max(...indices) + 1;

        return count;
    }

    static getFaceByFunction(count: number, vertices: number[], indices: number[], facevec: Vector3[][],
        face: Vector3[], path: Vector2[], holePath: Path[], fuc: Function): number {

        let shape = new Shape().setFromPoints(path);
        // 挖孔
        if (holePath && holePath.length > 0) {
            shape.holes.push(...holePath);
        }

        let geometry = new ShapeGeometry(shape);
        count = IronUtils.getFaceByGeometry(count, vertices, indices, facevec, face, geometry, fuc);

        geometry.dispose();

        return count;
    }

    static getYuanzhuVI(count: number, vertices: number[], indices: number[], facevec: Vector3[][], min: number, max: number, r: number, type: number = 0): number {
        // 段数
        let i: number, pot: Vector2, ver: Vector2[];
        let segment: number = 6;

        // 外圈
        let shape = new Shape()
            .moveTo(0, 0)
            .absarc(0, 0, r, 0, Math.PI * 2, true);

        let shapePoints = shape.extractPoints(segment);

        ver = shapePoints.shape;
        let reverse = !ShapeUtils.isClockWise(ver);
        if (reverse) {
            ver = ver.reverse();
        }

        let topVec: Vector3[] = [];
        let bottomVec: Vector3[] = [];
        let top: Vector3, bottom: Vector3;
        for (i = 0; i < ver.length; i++) {
            pot = ver[i];

            top = type === 1 ? new Vector3(pot.x, min, pot.y) :
                type === 2 ? new Vector3(pot.x, pot.y, min) :
                    new Vector3(min, pot.x, pot.y);
            bottom = type === 1 ? new Vector3(pot.x, max, pot.y) :
                type === 2 ? new Vector3(pot.x, pot.y, max) :
                    new Vector3(max, pot.x, pot.y);

            topVec.push(top);
            bottomVec.push(bottom);
        }

        let side = MoldUtils.getSideVIF(bottomVec, topVec, count);
        vertices.push(...side[0]);
        indices.push(...side[1]);
        facevec.push(...side[2]);
        count = side[3];

        // 顶底
        let geometry = new CircleGeometry(r, segment * 2);
        count = IronUtils.getFaceByGeometry(count, vertices, indices, facevec, [], geometry, (a: number, b: number) => type === 1 ? [a, min, b] : type === 2 ? [a, b, min] : [min, a, b]);
        count = IronUtils.getFaceByGeometry(count, vertices, indices, facevec, [], geometry, (a: number, b: number) => type === 1 ? [a, max, b] : type === 2 ? [a, b, max] : [max, a, b]);
        geometry.dispose();

        return count;
    }

    /**
     * 对拉螺杆
     * @param data 
     * @param thick 
     * @returns 
     */
    static getScrewVI(data: ALParams): any[] {
        // 数据
        let vertices: any[] = [];
        let indices: any[] = [];
        let facevec: any[] = [];
        // 计数
        let count: number = 0;

        let L: number = Number(data.L);
        let dpW: number = Number(data.dpW);
        let lgzj: number = Number(data.lgzj);

        data.duan = [
            0, 0, -L / 2,
            0, 0, L / 2
        ]

        // 螺杆
        count = IronUtils.getYuanzhuVI(count, vertices, indices, facevec, -L / 2, L / 2, lgzj / 2, 2);

        // 垫片
        count = IronUtils.getShimVI(count, vertices, indices, facevec, lgzj, dpW, -L / 2 + 20);
        count = IronUtils.getShimVI(count, vertices, indices, facevec, lgzj, dpW, L / 2 - 26);

        return [vertices, indices, facevec];
    }

    /**
     * 矩形垫片
     * @param count 
     * @param vertices 
     * @param indices 
     * @param facevec 
     * @param dpW 
     * @param z 
     * @param dphd 
     * @returns 
     */
    static getShimVI(count: number, vertices: number[], indices: number[], facevec: Vector3[][], lgzj: number, dpW: number, z: number, dphd: number = 6): number {
        let dpr = Math.sqrt(dpW * dpW / 2);
        let bface = [
            new Vector3(0, dpr, z),
            new Vector3(dpr, 0, z),
            new Vector3(0, -dpr, z),
            new Vector3(-dpr, 0, z)
        ];

        let tface = [
            new Vector3(0, dpr, z + dphd),
            new Vector3(dpr, 0, z + dphd),
            new Vector3(0, -dpr, z + dphd),
            new Vector3(-dpr, 0, z + dphd)
        ];

        let side = MoldUtils.getSideVIF([...bface, bface[0]], [...tface, tface[0]], count);
        vertices.push(...side[0]);
        indices.push(...side[1]);
        facevec.push(...side[2]);
        count = side[3];

        // 看需不需要打孔
        let path = [
            new Vector2(0, dpr),
            new Vector2(dpr, 0),
            new Vector2(0, -dpr),
            new Vector2(-dpr, 0)
        ]

        let holePath = new Path()
            .moveTo(0, 0)
            .absarc(0, 0, lgzj / 2, 0, Math.PI * 2, false);
        let tmpholes = MoldUtils.getHoleByDivisions([holePath]);

        count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, tface, path, tmpholes, (a: number, b: number) => [a, b, z + dphd]);
        count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, bface, path, tmpholes, (a: number, b: number) => [a, b, z]);

        return count;
    }

    /**
     * 蜡烛台
     * @param data 
     * @returns 
     */
    static getSandlestickVI(data: ALParams): any[] {
        // 数据
        let vertices: any[] = [];
        let indices: any[] = [];
        let facevec: any[] = [];
        // 计数
        let count: number = 0;

        let L: number = Number(data.L);
        let dphd: number = Number(data.dphd);
        let lgzj: number = Number(data.lgzj);
        let dpzj: number = Number(data.dpzj);
        let dpjdb: number = Number(data.dpjdb);

        data.duan = [
            0, L, 0,
            0, L - 100, 0
        ]

        // 垫片
        count = MoldUtils.getCylinderVI(count, vertices, indices, facevec, 0, 0, dpzj, dpjdb - dphd, dpjdb, (dpzj - lgzj) / 2, true);
        //螺杆
        count = IronUtils.getYuanzhuVI(count, vertices, indices, facevec, 0, L, lgzj / 2, 1);


        return [vertices, indices, facevec];
    }

    /**
     * U字码
     * @param data 
     * @returns 
     */
    static getUcodeVI(data: ALParams): any[] {
        // 数据
        let vertices: any[] = [];
        let indices: any[] = [];
        let facevec: any[] = [];
        // 计数
        let count: number = 0;

        let L: number = Number(data.L);
        let W: number = Number(data.W);
        let H: number = Number(data.H);
        let tphd: number = Number(data.tphd);
        let kkzj: string = data.kkzj;

        data.duan = [
            -L / 2, W / 2 - tphd, 0,
            -L / 2, -W / 2 + tphd, 0,
            L / 2, -W / 2 + tphd, 0,
            L / 2, W / 2 - tphd, 0
        ]

        let path: Vector2[];
        let holePath: Path;
        let backface: Vector3[], frontface: Vector3[];

        // 孔板
        backface = [
            new Vector3(-L / 2, W / 2, 0),
            new Vector3(-L / 2, -W / 2, 0),
            new Vector3(L / 2, -W / 2, 0),
            new Vector3(L / 2, W / 2, 0)
        ]

        frontface = [
            new Vector3(-L / 2, W / 2, tphd),
            new Vector3(-L / 2, -W / 2, tphd),
            new Vector3(L / 2, -W / 2, tphd),
            new Vector3(L / 2, W / 2, tphd)
        ]

        let side = MoldUtils.getSideVIF([...backface, backface[0]], [...frontface, frontface[0]], count);
        vertices.push(...side[0]);
        indices.push(...side[1]);
        facevec.push(...side[2]);
        count = side[3];

        path = [
            new Vector2(-L / 2, W / 2),
            new Vector2(-L / 2, -W / 2),
            new Vector2(L / 2, -W / 2),
            new Vector2(L / 2, W / 2)
        ];

        let rAry = kkzj.split('*');
        if (rAry && rAry.length === 2) {
            let vr: number = parseFloat(rAry[0]);
            let hr: number = parseFloat(rAry[1]);
            holePath = new Path()
                .moveTo(0, 0)
                .absarc(-hr / 2 + vr / 2, 0, vr / 2, Math.PI * 0.5, Math.PI * 1.5, false)
                .lineTo(hr / 2 - vr / 2, -vr / 2)
                .absarc(hr / 2 - vr / 2, 0, vr / 2, -Math.PI * 0.5, Math.PI * 0.5, false)
                .lineTo(-hr / 2 + vr / 2, vr / 2);
        }

        count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, frontface, path, [holePath], (a: number, b: number) => [a, b, tphd]);
        count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, backface, path, [holePath], (a: number, b: number) => [a, b, 0]);

        // 顶板
        count = MoldUtils.getCuboidVI(count, vertices, indices, facevec, -L / 2, L / 2, W / 2 - tphd, W / 2, -H + tphd, 0);
        // 底板
        count = MoldUtils.getCuboidVI(count, vertices, indices, facevec, -L / 2, L / 2, -W / 2, -W / 2 + tphd, -H + tphd, 0);


        return [vertices, indices, facevec];
    }

    /**
    * L型U字码
    * @param data 
    * @returns 
    */
    static getLUcodeVI(data: ALParams): any[] {
        // 数据
        let vertices: any[] = [];
        let indices: any[] = [];
        let facevec: any[] = [];
        // 计数
        let count: number = 0;

        let L1: number = Number(data.L1);
        let L2: number = Number(data.L2);
        let W: number = Number(data.W);
        let H1: number = Number(data.H1);
        let H2: number = Number(data.H2);
        let tphd: number = Number(data.tphd);
        let kkzj: string = data.kkzj;

        // 夹角
        let angle = (data.p_jiajiao !== 0 && data.p_jiajiao % 180 === 0) ? data.p_jiajiao - 0.001 : data.p_jiajiao;
        let radian = angle / 180 * Math.PI;
        let cosA = Math.cos(radian);
        let sinA = Math.sin(radian);


        let duanpath = MoldUtils.getCornerPath(0, tphd, tphd, L1, L2, sinA, cosA);
        data.duan = [
            duanpath[0].x, W / 2 - tphd, duanpath[0].y,
            duanpath[1].x, W / 2 - tphd, duanpath[1].y,
            duanpath[5].x, W / 2 - tphd, duanpath[5].y,

            duanpath[0].x, -W / 2 + tphd, duanpath[0].y,
            duanpath[1].x, -W / 2 + tphd, duanpath[1].y,
            duanpath[5].x, -W / 2 + tphd, duanpath[5].y,
        ]

        // 
        let holes: Path[];
        let lholePath: Path, rholePath: Path;
        let backface: Vector3[], frontface: Vector3[];

        // 
        let tpath = MoldUtils.getCornerPath(0, -H2 + tphd, -H1 + tphd, L1, L2, sinA, cosA);
        // 上
        count = MoldUtils.getShapeVI(count, vertices, indices, facevec, tpath, null, 2, W / 2 - tphd, W / 2, false);
        // 下
        count = MoldUtils.getShapeVI(count, vertices, indices, facevec, tpath, null, 2, -W / 2, -W / 2 + tphd, false);

        // 右
        let rAry = kkzj.split('*');
        if (rAry && rAry.length === 2) {
            let vr: number = parseFloat(rAry[0]);
            let hr: number = parseFloat(rAry[1]);
            lholePath = new Path()
                .moveTo(0, 0)
                .absarc(L1 / 2 - hr / 2 + vr / 2, 0, vr / 2, Math.PI * 0.5, Math.PI * 1.5, false)
                .lineTo(L1 / 2 + hr / 2 - vr / 2, -vr / 2)
                .absarc(L1 / 2 + hr / 2 - vr / 2, 0, vr / 2, -Math.PI * 0.5, Math.PI * 0.5, false)
                .lineTo(L1 / 2 - hr / 2 + vr / 2, vr / 2);
            rholePath = new Path()
                .moveTo(0, 0)
                .absarc(L2 / 2 - hr / 2 + vr / 2, 0, vr / 2, Math.PI * 0.5, Math.PI * 1.5, false)
                .lineTo(L2 / 2 + hr / 2 - vr / 2, -vr / 2)
                .absarc(L2 / 2 + hr / 2 - vr / 2, 0, vr / 2, -Math.PI * 0.5, Math.PI * 0.5, false)
                .lineTo(L2 / 2 - hr / 2 + vr / 2, vr / 2);
        }

        // 右侧面孔
        holes = [rholePath];
        let xx: number = tphd / sinA + tphd / sinA * cosA;

        count = MoldUtils.getRightHoleVI(count, vertices, indices, facevec, holes,
            0, xx, L2, L2, -W / 2, W / 2, 0, tphd, cosA, sinA, H2, H1);

        // 左侧面孔
        holes = [lholePath];
        let fontp = MoldUtils.getLeftXieVi(0, 0, L1, sinA, cosA);
        let backp = MoldUtils.getLeftXieVi(tphd, tphd, L1, sinA, cosA);

        let backpath = [
            new Vector2(0, W / 2),
            new Vector2(fontp[2], W / 2),
            new Vector2(fontp[2], -W / 2),
            new Vector2(0, -W / 2)
        ]
        backface = MoldUtils.getLeftXieFaceVI(0, 0, L1, -W / 2, W / 2, sinA, cosA);

        let fontpath = [
            new Vector2(0, W / 2),
            new Vector2(backp[2], W / 2),
            new Vector2(backp[2], -W / 2),
            new Vector2(0, -W / 2)
        ]
        frontface = MoldUtils.getLeftXieFaceVI(tphd, tphd, L1, -W / 2, W / 2, sinA, cosA);

        count = MoldUtils.getLeftHoleVI(count, vertices, indices, facevec, holes, holes, backpath, fontpath, backface, frontface,
            tphd, tphd, tphd, sinA, cosA);

        return [vertices, indices, facevec];
    }

    /**
    * 支撑圆管
    * @param data 
    * @returns 
    */
    static getRoundPipeVI(data: ALParams): any[] {
        // 数据
        let vertices: any[] = [];
        let indices: any[] = [];
        let facevec: any[] = [];
        // 计数
        let count: number = 0;

        let L: number = Number(data.L);
        let ZCGdia: number = Number(data.ZCGdia);

        data.duan = [
            0, 0, 0,
            0, -L, 0
        ]

        count = MoldUtils.getCylinderVI(count, vertices, indices, facevec, 0, 0, ZCGdia, -L, 0, 2, true);

        return [vertices, indices, facevec];
    }

    /**
    * 斜支撑
    * @param data 
    * @returns 
    */
    static getSwayBracingVI(data: ALParams): any[] {
        // 数据
        let vertices: any[] = [];
        let indices: any[] = [];
        let facevec: any[] = [];
        // 计数
        let count: number = 0;

        let L: number = Number(data.L);

        data.L = parseInt(L.toFixed(0));

        let ZCGdia: number = Number(data.ZCGdia);

        // let p_arrangement = Number(data.p_arrangement);
        // let p_offwall = Number(data.p_offwall);
        // let p_xiehight = Number(data.p_xiehight);
        let p_groundangle = Number(data.p_groundangle);

        let zlen: number;
        let cosA: number;
        let sinA: number;

        zlen = L;

        let angle = (p_groundangle !== 0 && p_groundangle % 180 === 0) ? p_groundangle - 0.01 : p_groundangle;
        let radian = angle / 180 * Math.PI;
        cosA = Math.cos(radian);
        sinA = Math.sin(radian);



        // data.p_offwall = zlen * cosA;
        // data.p_xiehight = zlen * sinA;

        data.duan = [
            zlen * cosA, 0, 0,
            0, zlen * sinA, 0
        ]

        // 外
        let segment = 6;
        let shape = new Shape()
            .moveTo(0, 0)
            .absarc(0, 0, ZCGdia / 2, 0, Math.PI * 2, true);

        let shapePoints = shape.extractPoints(segment);

        let ver = shapePoints.shape;
        let reverse = !ShapeUtils.isClockWise(ver);
        if (reverse) {
            ver = ver.reverse();
        }

        let i: number;
        let pot: Vector2;
        let topVec: Vector3[] = [];
        let bottomVec: Vector3[] = [];
        for (i = 0; i < ver.length; i++) {
            pot = ver[i];
            topVec.push(new Vector3(pot.x * sinA, zlen * sinA + pot.x * cosA, pot.y));
            bottomVec.push(new Vector3(zlen * cosA + pot.x * sinA, pot.x * cosA, pot.y));
        }

        let side = MoldUtils.getSideVIF(bottomVec, topVec, count);
        vertices.push(...side[0]);
        indices.push(...side[1]);
        facevec.push(...side[2]);
        count = side[3];

        // 内
        shape = new Shape()
            .moveTo(0, 0)
            .absarc(0, 0, ZCGdia / 2 - 2, 0, Math.PI * 2, true);

        shapePoints = shape.extractPoints(segment);

        ver = shapePoints.shape;
        reverse = !ShapeUtils.isClockWise(ver);
        if (reverse) {
            ver = ver.reverse();
        }

        let itopVec: Vector3[] = [];
        let ibottomVec: Vector3[] = [];
        for (i = 0; i < ver.length; i++) {
            pot = ver[i];
            itopVec.push(new Vector3(pot.x * sinA, zlen * sinA + pot.x * cosA, pot.y));
            ibottomVec.push(new Vector3(zlen * cosA + pot.x * sinA, pot.x * cosA, pot.y));
        }

        side = MoldUtils.getSideVIF(ibottomVec, itopVec, count);
        vertices.push(...side[0]);
        indices.push(...side[1]);
        facevec.push(...side[2]);
        count = side[3];

        // 顶底
        side = MoldUtils.getSideVIF(ibottomVec, bottomVec, count);
        vertices.push(...side[0]);
        indices.push(...side[1]);
        facevec.push(...side[2]);
        count = side[3];

        side = MoldUtils.getSideVIF(itopVec, topVec, count);
        vertices.push(...side[0]);
        indices.push(...side[1]);
        facevec.push(...side[2]);
        count = side[3];


        return [vertices, indices, facevec];
    }


    static getHanjiePos(hjwz: string): WeldedType[] {
        let lenagAry = hjwz.split(')');
        let laAry: string[];
        let lenangle: string[];
        let wt: WeldedType;
        let configs: WeldedType[] = []
        for (let lenag of lenagAry) {

            laAry = lenag.split('(');
            if (laAry.length === 2) {
                lenangle = laAry[1].split(',');
                if (lenangle.length === 4) {
                    wt = {
                        pos: parseFloat(lenangle[0]),
                        len: parseFloat(lenangle[1]),
                        dir: parseInt(lenangle[2]),
                        lr: parseInt(lenangle[3])
                    }
                    configs.push(wt);
                }
            }
        }

        return configs;
    }

    /**
    * 方管
    * @param data 
    * @returns 
    */
    static getSquareTubeVI(data: ALParams): any[] {
        // 数据
        let vertices: any[] = [];
        let indices: any[] = [];
        let facevec: any[] = [];
        // 计数
        let count: number = 0;

        let L: number = Number(data.L);
        let W: number = Number(data.W);
        let H: number = Number(data.H);

        let left_mbH: number = Number(data.left_mbH);
        let left_mbW: number = Number(data.left_mbW);

        let right_mbH: number = Number(data.right_mbH);
        let right_mbW: number = Number(data.right_mbW);

        let tphd: number = Number(data.tphd);
        let hjxchd: number = Number(data.hjxchd);
        let bkkjjcm_dis: number = Number(data.bkkjjcm_dis);
        let kkzj: number = Number(data.kkzj);
        let jgW: number = Number(data.jgW);

        // 
        let path: Vector2[];
        let holePath: Path;
        let holes: Path[];
        let i: number, xv: number, yv: number;

        data.zhong = {
            L: [
                {
                    pointer: [L, 0, W / 2],
                    center: [L / 2, 0, W / 2]
                }
            ],
            RL: [
                {
                    pointer: [0, 0, W / 2],
                    center: [L / 2, 0, W / 2]
                }
            ]
        }

        data.duan = [
            0, 0, 0,
            0, 0, left_mbW,
            L, 0, right_mbW,
            L, 0, 0
        ]

        // 孔位


        // 管
        count = MoldUtils.getCuboidVI(count, vertices, indices, facevec, hjxchd, L - hjxchd, 0, H, 0, W);

        // 左面板
        path = [
            new Vector2(0, 0),
            new Vector2(0, left_mbW),
            new Vector2(left_mbH, left_mbW),
            new Vector2(left_mbH, 0)
        ];

        holes = [];
        let zbkk = AModelFmulaUtils.getHolesbyExpress(data[AK.p_zkkw], left_mbH, 2, data, AK.p_zkkw);
        for (i = 0; i < zbkk.length; i++) {
            xv = zbkk[i];
            yv = bkkjjcm_dis;

            holePath = new Path();
            holePath.moveTo(xv, yv)
                .absarc(xv, yv, kkzj / 2, 0, Math.PI * 2, true);

            holes.push(holePath);
        }
        count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 1, 0, hjxchd, false);

        // 右面板
        path = [
            new Vector2(0, 0),
            new Vector2(0, right_mbW),
            new Vector2(right_mbH, right_mbW),
            new Vector2(right_mbH, 0)
        ];
        holes = [];
        let ybkk = AModelFmulaUtils.getHolesbyExpress(data[AK.p_ykkw], right_mbH, 2, data, AK.p_ykkw);
        for (i = 0; i < ybkk.length; i++) {
            xv = ybkk[i];
            yv = bkkjjcm_dis;

            holePath = new Path();
            holePath.moveTo(xv, yv)
                .absarc(xv, yv, kkzj / 2, 0, Math.PI * 2, true);

            holes.push(holePath);
        }

        count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 1, L - hjxchd, L, false);

        // 焊接件
        let configs: WeldedType[] = IronUtils.getHanjiePos(data.p_hjwz);

        for (let i = 0; i < configs.length; i++) {

            // 初始化焊接件
            if (!data.p_kws[i]) {
                let { pos, len, dir, lr } = configs[i];
                if (dir === 1) {
                    data.p_kws[i] = ['', '(' + 40 + ',' + 50 + ')'];
                }
                else if (dir === 3) {
                    data.p_kws[i] = ['(' + jgW / 2 + ',' + jgW / 2 + ')', ''];
                }
                else if (dir === 4) {
                    data.p_kws[i] = ['', '(' + 50 + ',' + 40 + ')'];
                }
                else {
                    data.p_kws[i] = ['', '(' + 50 + ',' + 40 + ')'];
                }

                data.p_spkw = data.p_kws[i][0];
                data.p_szkw = data.p_kws[i][1];
            }

            count = IronUtils.getWeldedPlateVI(count, vertices, indices, facevec, L, W, H, jgW, hjxchd, configs[i], kkzj, data.p_kws[i], data);
        }

        return [vertices, indices, facevec];
    }

    static getKuohaoKong(str: string): any[] {
        if (!str || str === '') {
            return null;
        }

        let posAry = [];
        let dataAry = str.split(')');
        let jgdata: string[];
        let truedata: string[]
        for (let jg of dataAry) {
            jgdata = jg.split('(');
            for (let jgary of jgdata) {
                if (jgary !== '') {
                    truedata = jgary.split(',');
                    posAry.push(truedata);
                }
            }
        }

        return posAry;
    }

    /**
     * 焊接件
     * @param count 
     * @param vertices 
     * @param indices 
     * @param facevec 
     * @param L 
     * @param W 
     * @param H 
     * @param jgW 角钢宽
     * @param hjxchd 焊接形成厚度
     * @param type 
     * @returns 
     */
    static getWeldedPlateVI(count: number, vertices: number[], indices: number[], facevec: Vector3[][],
        L: number, W: number, H: number, jgW: number, hjxchd: number, type: WeldedType, kkzj: number, p_kws: string[], data: ALParams): number {

        const { pos, len, dir, lr } = type;

        // 0 左偏 1 右偏
        let p_offsettype: number = data.p_offsettype;
        // 偏移距离
        let p_offsetvalue: number = data.p_offsetvalue;

        // 孔
        let xv: number, yv: number;

        let spk: string[][];
        let szk: string[][];
        if (p_kws && p_kws.length == 2) {
            spk = IronUtils.getKuohaoKong(p_kws[0]);
            szk = IronUtils.getKuohaoKong(p_kws[1]);
        }

        let i: number;
        let path: Vector2[];
        let holePath: Path;
        let sholes: Path[];
        let vholes: Path[];


        if (dir === 1) {

            if (p_offsettype === 0) {
                path = lr === 2 ? [
                    new Vector2(pos, -p_offsetvalue + 0),
                    new Vector2(pos, -p_offsetvalue + len),
                    new Vector2(pos + jgW, -p_offsetvalue + len),
                    new Vector2(pos + jgW, -p_offsetvalue + 0)
                ] : [
                    new Vector2(pos, -p_offsetvalue + 0),

                    new Vector2(pos, -p_offsetvalue + len),
                    new Vector2(pos - jgW, -p_offsetvalue + len),
                    new Vector2(pos - jgW, -p_offsetvalue + 0)
                ];
            }
            else {
                path = lr === 2 ? [
                    new Vector2(pos, p_offsetvalue + W),
                    new Vector2(pos, p_offsetvalue + W - len),
                    new Vector2(pos + jgW, p_offsetvalue + W - len),
                    new Vector2(pos + jgW, p_offsetvalue + W)
                ] : [
                    new Vector2(pos, p_offsetvalue + W),

                    new Vector2(pos, p_offsetvalue + W - len),
                    new Vector2(pos - jgW, p_offsetvalue + W - len),
                    new Vector2(pos - jgW, p_offsetvalue + W)
                ];
            }

            sholes = [];

            if (spk && spk.length > 0) {
                for (i = 0; i < spk.length; i++) {
                    xv = lr === 1 ? pos - jgW + Number(spk[i][0]) : pos + Number(spk[i][0]);
                    yv = p_offsettype === 0 ? -p_offsetvalue + len - Number(spk[i][1]) : p_offsetvalue + W - len + Number(spk[i][1]);

                    data.duan.push(xv, H + hjxchd, yv);

                    holePath = new Path()
                        .moveTo(xv, yv)
                        .absarc(xv, yv, kkzj / 2, 0, Math.PI * 2, true);

                    sholes.push(holePath);
                }
            }

            count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, sholes, 2, H, H + hjxchd, false);

            path = p_offsettype === 0 ? [
                new Vector2(H, 0 - p_offsetvalue),
                new Vector2(H + jgW, 0 - p_offsetvalue),
                new Vector2(H + jgW, len - p_offsetvalue),
                new Vector2(H, len - p_offsetvalue)
            ] : [
                new Vector2(H, W + p_offsetvalue),
                new Vector2(H + jgW, W + p_offsetvalue),
                new Vector2(H + jgW, W - len + p_offsetvalue),
                new Vector2(H, W - len + p_offsetvalue)
            ];

            vholes = []
            if (szk && szk.length > 0) {
                for (i = 0; i < szk.length; i++) {
                    xv = H + Number(szk[i][0]);
                    yv = p_offsettype === 0 ? -p_offsetvalue + len - Number(szk[i][1]) : W - len + p_offsetvalue + Number(szk[i][1]);

                    data.duan.push(pos, xv, yv);

                    holePath = new Path()
                        .moveTo(xv, yv)
                        .absarc(xv, yv, kkzj / 2, 0, Math.PI * 2, true);

                    vholes.push(holePath);
                }
            }
            if (lr === 1) {
                count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, vholes, 1, pos - hjxchd, pos, false);
            }
            else {
                count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, vholes, 1, pos, pos + hjxchd, false);
            }

        }
        else if (dir === 3) {
            path = [
                new Vector2(pos, W),
                new Vector2(pos, W + jgW),
                new Vector2(pos + jgW, W + jgW),
                new Vector2(pos + jgW, W)
            ];

            sholes = [];

            if (spk && spk.length > 0) {
                for (i = 0; i < spk.length; i++) {
                    xv = pos + Number(spk[i][0]);
                    yv = W + jgW - Number(spk[i][1]);

                    data.duan.push(xv, len, yv);

                    holePath = new Path()
                        .moveTo(xv, yv)
                        .absarc(xv, yv, kkzj / 2, 0, Math.PI * 2, true);

                    sholes.push(holePath);
                }
            }

            count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, sholes, 2, len - hjxchd, len, false);

            path = [
                new Vector2(pos, 0),
                new Vector2(pos + jgW, 0),
                new Vector2(pos + jgW, len),
                new Vector2(pos, len)
            ];

            vholes = []
            if (szk && szk.length > 0) {
                for (i = 0; i < szk.length; i++) {
                    xv = pos + Number(szk[i][0]);
                    yv = Number(szk[i][1]);

                    data.duan.push(xv, yv, W + hjxchd);

                    holePath = new Path()
                        .moveTo(xv, yv)
                        .absarc(xv, yv, kkzj / 2, 0, Math.PI * 2, true);

                    vholes.push(holePath);
                }
            }

            count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, vholes, 0, W, W + hjxchd, false);
        }
        else if (dir === 4) {


            path = lr === 2 ? [
                new Vector2(pos, H),
                new Vector2(pos + jgW, H),
                new Vector2(pos + jgW, H + len),
                new Vector2(pos, H + len)
            ] : [
                new Vector2(pos - jgW, H),
                new Vector2(pos, H),
                new Vector2(pos, len + H),
                new Vector2(pos - jgW, len + H)
            ];

            sholes = [];

            if (spk && spk.length > 0) {
                for (i = 0; i < spk.length; i++) {
                    xv = lr === 1 ? pos - jgW + Number(spk[i][0]) : pos + Number(spk[i][0]);
                    yv = len + H - Number(spk[i][1]);

                    data.duan.push(xv, yv, 0);

                    holePath = new Path()
                        .moveTo(xv, yv)
                        .absarc(xv, yv, kkzj / 2, 0, Math.PI * 2, true);

                    sholes.push(holePath);
                }
            }
            if (p_offsettype === 0) {
                count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, sholes, 0, 0, hjxchd, false);
            }
            else {
                count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, sholes, 0, W - hjxchd, W, false);
            }

            path = p_offsettype === 0 ? [
                new Vector2(H, 0),
                new Vector2(H + len, 0),
                new Vector2(H + len, jgW),
                new Vector2(H, jgW)
            ] : [
                new Vector2(H, W - jgW),
                new Vector2(H + len, W - jgW),
                new Vector2(H + len, W),
                new Vector2(H, W)
            ];

            vholes = []
            if (szk && szk.length > 0) {
                for (i = 0; i < szk.length; i++) {
                    xv = H + len - Number(szk[i][0]);
                    yv = p_offsettype === 0 ? Number(szk[i][1]) : W - Number(szk[i][1]);

                    data.duan.push(pos, xv, yv);

                    holePath = new Path()
                        .moveTo(xv, yv)
                        .absarc(xv, yv, kkzj / 2, 0, Math.PI * 2, true);

                    vholes.push(holePath);
                }
            }

            if (lr === 1) {
                count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, vholes, 1, pos - hjxchd, pos, false);
            }
            else {
                count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, vholes, 1, pos, pos + hjxchd, false);
            }

        }
        else {

            path = lr === 2 ? [
                new Vector2(pos, 0),
                new Vector2(pos + jgW, 0),
                new Vector2(pos + jgW, len),
                new Vector2(pos, len)
            ] : [
                new Vector2(pos - jgW, 0),
                new Vector2(pos, 0),
                new Vector2(pos, len),
                new Vector2(pos - jgW, len)
            ];

            sholes = [];

            if (spk && spk.length > 0) {
                for (i = 0; i < spk.length; i++) {
                    xv = lr === 1 ? pos - jgW + Number(spk[i][0]) : pos + Number(spk[i][0]);
                    yv = len - Number(spk[i][1]);

                    data.duan.push(xv, yv, W);

                    holePath = new Path()
                        .moveTo(xv, yv)
                        .absarc(xv, yv, kkzj / 2, 0, Math.PI * 2, true);

                    sholes.push(holePath);
                }
            }

            if (p_offsettype === 0) {
                count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, sholes, 0, W, W + hjxchd, false);
            }
            else {
                count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, sholes, 0, -hjxchd, 0, false);
            }

            path = p_offsettype === 1 ? [
                new Vector2(0, 0),
                new Vector2(len, 0),
                new Vector2(len, -jgW),
                new Vector2(0, -jgW)
            ] : [
                new Vector2(0, W),
                new Vector2(len, W),
                new Vector2(len, W + jgW),
                new Vector2(0, W + jgW)
            ];

            vholes = []
            if (szk && szk.length > 0) {
                for (i = 0; i < szk.length; i++) {
                    xv = len - Number(szk[i][0]);
                    yv = p_offsettype === 1 ? - Number(szk[i][1]) : W + Number(szk[i][1]);

                    data.duan.push(pos, xv, yv);

                    holePath = new Path()
                        .moveTo(xv, yv)
                        .absarc(xv, yv, kkzj / 2, 0, Math.PI * 2, true);

                    vholes.push(holePath);
                }
            }
            if (lr === 1) {
                count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, vholes, 1, pos - hjxchd, pos, false);
            }
            else {
                count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, vholes, 1, pos, pos + hjxchd, false);
            }
        }

        return count;
    }

    /**
     * L方管
     * @param data 
     * @returns 
     */
    static getLSquareTubeVI(data: ALParams): any[] {

        // 数据
        let vertices: any[] = [];
        let indices: any[] = [];
        let facevec: any[] = [];
        // 计数
        let count: number = 0;

        // 后台数据
        let L1: number = Number(data.L1);
        let L2: number = Number(data.L2);
        let W: number = Number(data.W);
        let H: number = Number(data.H);

        let left_mbH: number = Number(data.left_mbH);
        let left_mbW: number = Number(data.left_mbW);

        let right_mbH: number = Number(data.right_mbH);
        let right_mbW: number = Number(data.right_mbW);

        let tphd: number = Number(data.tphd);
        let hjxchd: number = Number(data.hjxchd);
        let bkkjjcm_dis: number = Number(data.bkkjjcm_dis);
        let kkzj: number = Number(data.kkzj);
        let jgW: number = Number(data.jgW);
        // 夹角
        let angle = (data.p_jiajiao !== 0 && data.p_jiajiao % 180 === 0) ? data.p_jiajiao - 0.001 : data.p_jiajiao;
        let radian = angle / 180 * Math.PI;
        let cosA = Math.cos(radian);
        let sinA = Math.sin(radian);

        // 
        let path: Vector2[];
        let holePath: Path;
        let holes: Path[];
        let backface: Vector3[], frontface: Vector3[];
        let i: number, xv: number, yv: number;

        // data.p_kws[data.p_selecttarget] = [data.p_spkw, data.p_szkw];

        // data.p_kws2[data.p_selecttarget2] = [data.p_spkw2, data.p_szkw2];

        // 轮廓
        let duanPath = MoldUtils.getCornerPath(0, W, W, L1 + hjxchd, L2 + hjxchd, sinA, cosA);
        let duanPath2 = MoldUtils.getCornerPath(0, left_mbW, right_mbW, L1 + hjxchd, L2 + hjxchd, sinA, cosA);
        data.duan = [
            duanPath[0].x, 0, duanPath[0].y,
            duanPath[1].x, 0, duanPath[1].y,
            duanPath2[2].x, 0, duanPath2[2].y,
            duanPath[3].x, 0, duanPath[3].y,
            duanPath2[4].x, 0, duanPath2[4].y,
            duanPath[5].x, 0, duanPath[5].y
        ];

        let l1c = duanPath[1].clone().add(duanPath[2]).multiplyScalar(0.5);
        let l2c = duanPath[4].clone().add(duanPath[5]).multiplyScalar(0.5);
        let ct = duanPath[0].clone().add(duanPath[3]).multiplyScalar(0.5);
        data.zhong = {
            L1: [
                {
                    pointer: [l1c.x, 0, l1c.y],
                    center: [ct.x, 0, ct.y]
                }
            ],
            L2: [
                {
                    pointer: [l2c.x, 0, l2c.y],
                    center: [ct.x, 0, ct.y]
                }
            ]
        }

        // 管
        let tpath = MoldUtils.getCornerPath(0, W, W, L1, L2, sinA, cosA);
        count = MoldUtils.getShapeVI(count, vertices, indices, facevec, tpath, null, 2, 0, H, false);



        // 右侧板
        path = [
            new Vector2(0, 0),
            new Vector2(0, right_mbW),
            new Vector2(right_mbH, right_mbW),
            new Vector2(right_mbH, 0)
        ];

        holes = [];
        let ybkk = AModelFmulaUtils.getHolesbyExpress(data[AK.p_ykkw], right_mbH, 2, data, AK.p_ykkw);
        for (i = 0; i < ybkk.length; i++) {
            xv = ybkk[i];
            yv = bkkjjcm_dis;

            holePath = new Path();
            holePath.moveTo(xv, yv)
                .absarc(xv, yv, kkzj / 2, 0, Math.PI * 2, true);

            holes.push(holePath);
        }
        count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 1, L2, L2 + hjxchd, false);
        // 左侧板

        backface = [
            new Vector3(L1 * cosA, 0, L1 * sinA),
            new Vector3(L1 * cosA, left_mbH, L1 * sinA),
            new Vector3(L1 * cosA + left_mbW * sinA, left_mbH, L1 * sinA - left_mbW * cosA),
            new Vector3(L1 * cosA + left_mbW * sinA, 0, L1 * sinA - left_mbW * cosA)
        ];
        frontface = [
            new Vector3((L1 + hjxchd) * cosA, 0, (L1 + hjxchd) * sinA),
            new Vector3((L1 + hjxchd) * cosA, left_mbH, (L1 + hjxchd) * sinA),
            new Vector3((L1 + hjxchd) * cosA + left_mbW * sinA, left_mbH, (L1 + hjxchd) * sinA - left_mbW * cosA),
            new Vector3((L1 + hjxchd) * cosA + left_mbW * sinA, 0, (L1 + hjxchd) * sinA - left_mbW * cosA)
        ];

        path = [
            new Vector2(0, 0),
            new Vector2(left_mbW, 0),
            new Vector2(left_mbW, left_mbH),
            new Vector2(0, left_mbH)
        ];
        holes = [];
        let zbkk = AModelFmulaUtils.getHolesbyExpress(data[AK.p_zkkw], left_mbH, 2, data, AK.p_zkkw);
        for (i = 0; i < zbkk.length; i++) {
            xv = bkkjjcm_dis;
            yv = zbkk[i];

            holePath = new Path();
            holePath.moveTo(xv, yv)
                .absarc(xv, yv, kkzj / 2, 0, Math.PI * 2, true);

            holes.push(holePath);
        }
        count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, frontface, path, holes,
            (a: number, b: number) => [a * sinA + L1 * cosA, b, -a * cosA + L1 * sinA]);
        count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, backface, path, holes,
            (a: number, b: number) => [a * sinA + (L1 + hjxchd) * cosA, b, -a * cosA + (L1 + hjxchd) * sinA]);



        let side = MoldUtils.getSideVIF([...backface, backface[0]], [...frontface, frontface[0]], count);
        vertices.push(...side[0]);
        indices.push(...side[1]);
        facevec.push(...side[2]);
        count = side[3];

        // 左侧
        let lconfigs: WeldedType[] = IronUtils.getHanjiePos(data.p_hjwz2);
        for (let i = 0; i < lconfigs.length; i++) {

            if (!data.p_kws2[i]) {
                let { dir } = lconfigs[i];
                if (dir === 1) {
                    data.p_kws2[i] = ['', '(' + 40 + ',' + 50 + ')'];
                }
                else if (dir === 3) {
                    data.p_kws2[i] = ['(' + jgW / 2 + ',' + jgW / 2 + ')', ''];
                }
                else if (dir === 4) {
                    data.p_kws2[i] = ['', '(' + 50 + ',' + 40 + ')'];
                }
                else {
                    data.p_kws2[i] = ['', '(' + 50 + ',' + 40 + ')'];
                }

                data.p_spkw2 = data.p_kws2[i][0];
                data.p_szkw2 = data.p_kws2[i][1];
            }

            count = IronUtils.getXieWeldedPalteVI(count, vertices, indices, facevec, L1, L2, W, H, sinA, cosA, jgW, kkzj, hjxchd, lconfigs[i], data.p_kws2[i], data);
        }

        // 右侧
        let rconfigs: WeldedType[] = IronUtils.getHanjiePos(data.p_hjwz);

        for (let i = 0; i < rconfigs.length; i++) {

            // 初始化焊接件
            // 初始化焊接件
            if (!data.p_kws[i]) {
                let { pos, len, dir, lr } = rconfigs[i];
                if (dir === 1) {
                    data.p_kws[i] = ['', '(' + 40 + ',' + 50 + ')'];
                }
                else if (dir === 3) {
                    data.p_kws[i] = ['(' + jgW / 2 + ',' + jgW / 2 + ')', ''];
                }
                else if (dir === 4) {
                    data.p_kws[i] = ['', '(' + 50 + ',' + 40 + ')'];
                }
                else {
                    data.p_kws[i] = ['', '(' + 50 + ',' + 40 + ')'];
                }

                data.p_spkw = data.p_kws[i][0];
                data.p_szkw = data.p_kws[i][1];
            }

            count = IronUtils.getWeldedPlateVI(count, vertices, indices, facevec, L2, W, H, jgW, hjxchd, rconfigs[i], kkzj, data.p_kws[i], data);
        }


        return [vertices, indices, facevec];
    }


    static getXieWeldedPalteVI(count: number, vertices: number[], indices: number[], facevec: Vector3[][],
        L1: number, L2: number, W: number, H: number, sinA: number, cosA: number, jgW: number, kkzj: number, hjxchd: number,
        configs: WeldedType, p_kws: string[], data: ALParams): number {

        const { pos, len, dir, lr } = configs;

        let path = MoldUtils.getCornerPath(0, W, W, L1, L2, sinA, cosA);
        let tmpPath1: Vector2[];
        let tmpPath2: Vector2[];
        let tmpPath3: Vector2[];
        let tmpPath4: Vector2[];
        let tmpPath5: Vector2[];
        let side: any[];
        let frontface: Vector3[], backface: Vector3[];

        // 0 左偏 1 右偏
        let p_offsettype: number = data.p_offsettype2;
        // 偏移距离
        let p_offsetvalue: number = data.p_offsetvalue2;


        let xv: number, yv: number;

        let spk: string[][];
        let szk: string[][];
        if (p_kws && p_kws.length == 2) {
            spk = IronUtils.getKuohaoKong(p_kws[0]);
            szk = IronUtils.getKuohaoKong(p_kws[1]);
        }

        let i: number;

        let holePath: Path;
        let sholes: Path[];
        let vholes: Path[];

        tmpPath1 = MoldUtils.getCornerPath(0, W, W, L1, L2, sinA, cosA);
        let lvd = tmpPath1[1].clone().sub(tmpPath1[0]).normalize();
        let wv = tmpPath1[2].clone().sub(tmpPath1[1]).normalize();
        let wdir = new Vector3(wv.x, 0, wv.y);
        let ldir = new Vector3(lvd.x, 0, lvd.y);
        let hdir = new Vector3(0,1,0);


        if (dir === 1) {
            tmpPath1 = MoldUtils.getCornerPath(0, len, len, pos, L2, sinA, cosA);
            tmpPath2 = MoldUtils.getCornerPath(0, len, len, pos - hjxchd, L2, sinA, cosA);
            tmpPath3 = MoldUtils.getCornerPath(0, len, len, pos + hjxchd, L2, sinA, cosA);
            tmpPath4 = MoldUtils.getCornerPath(0, len, len, pos + jgW, L2, sinA, cosA);
            tmpPath5 = MoldUtils.getCornerPath(0, len, len, pos - jgW, L2, sinA, cosA);

            // 左偏移
            if (p_offsettype === 0) {
                tmpPath1 = MoldUtils.getCornerPath(-p_offsetvalue, len - p_offsetvalue, len - p_offsetvalue, pos, L2, sinA, cosA);
                tmpPath2 = MoldUtils.getCornerPath(-p_offsetvalue, len - p_offsetvalue, len - p_offsetvalue, pos - hjxchd, L2, sinA, cosA);
                tmpPath3 = MoldUtils.getCornerPath(-p_offsetvalue, len - p_offsetvalue, len - p_offsetvalue, pos + hjxchd, L2, sinA, cosA);
                tmpPath4 = MoldUtils.getCornerPath(-p_offsetvalue, len - p_offsetvalue, len - p_offsetvalue, pos + jgW, L2, sinA, cosA);
                tmpPath5 = MoldUtils.getCornerPath(-p_offsetvalue, len - p_offsetvalue, len - p_offsetvalue, pos - jgW, L2, sinA, cosA);
            }
            else {
                tmpPath1 = MoldUtils.getCornerPath(-len + W + p_offsetvalue, W + p_offsetvalue, W + p_offsetvalue, pos, L2, sinA, cosA);
                tmpPath2 = MoldUtils.getCornerPath(-len + W + p_offsetvalue, W + p_offsetvalue, W + p_offsetvalue, pos - hjxchd, L2, sinA, cosA);
                tmpPath3 = MoldUtils.getCornerPath(-len + W + p_offsetvalue, W + p_offsetvalue, W + p_offsetvalue, pos + hjxchd, L2, sinA, cosA);
                tmpPath4 = MoldUtils.getCornerPath(-len + W + p_offsetvalue, W + p_offsetvalue, W + p_offsetvalue, pos + jgW, L2, sinA, cosA);
                tmpPath5 = MoldUtils.getCornerPath(-len + W + p_offsetvalue, W + p_offsetvalue, W + p_offsetvalue, pos - jgW, L2, sinA, cosA);
            }

            // 左
            if (lr === 1) {



                // 水平
                frontface = [
                    new Vector3(tmpPath1[1].x, H + hjxchd, tmpPath1[1].y),
                    new Vector3(tmpPath1[2].x, H + hjxchd, tmpPath1[2].y),
                    new Vector3(tmpPath5[2].x, H + hjxchd, tmpPath5[2].y),
                    new Vector3(tmpPath5[1].x, H + hjxchd, tmpPath5[1].y)
                ]
                backface = [
                    new Vector3(tmpPath1[1].x, H, tmpPath1[1].y),
                    new Vector3(tmpPath1[2].x, H, tmpPath1[2].y),
                    new Vector3(tmpPath5[2].x, H, tmpPath5[2].y),
                    new Vector3(tmpPath5[1].x, H, tmpPath5[1].y)
                ]

                path = p_offsettype === 0 ? [
                    new Vector2(-p_offsetvalue, 0),
                    new Vector2(len - p_offsetvalue, 0),
                    new Vector2(len - p_offsetvalue, jgW),
                    new Vector2(-p_offsetvalue, jgW)
                ] : [
                    new Vector2(-len + W + p_offsetvalue, 0),
                    new Vector2(W + p_offsetvalue, 0),
                    new Vector2(W + p_offsetvalue, jgW),
                    new Vector2(-len + W + p_offsetvalue, jgW)
                ];

                sholes = [];

                if (spk && spk.length > 0) {
                    for (i = 0; i < spk.length; i++) {
                        xv = p_offsettype === 0 ? -p_offsetvalue + len - Number(spk[i][0]) : -len + W + p_offsetvalue + Number(spk[i][0]);
                        yv = Number(spk[i][1]);

                        data.duan.push(xv * sinA + (pos - yv) * cosA, H + hjxchd, (pos - yv) * sinA - xv * cosA);

                        holePath = new Path()
                            .moveTo(xv, yv)
                            .absarc(xv, yv, kkzj / 2, 0, Math.PI * 2, true);

                        sholes.push(holePath);
                    }
                }

                count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, frontface, path, sholes,
                    (a: number, b: number) => [a * sinA + (pos - b) * cosA, H + hjxchd, (pos - b) * sinA - a * cosA]);
                count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, backface, path, sholes,
                    (a: number, b: number) => [a * sinA + (pos - b) * cosA, H, (pos - b) * sinA - a * cosA]);

                side = MoldUtils.getSideVIF([...backface, backface[0]], [...frontface, frontface[0]], count);
                vertices.push(...side[0]);
                indices.push(...side[1]);
                facevec.push(...side[2]);
                count = side[3];

                // 竖直
                frontface = [
                    new Vector3(tmpPath1[1].x, H, tmpPath1[1].y),
                    new Vector3(tmpPath1[2].x, H, tmpPath1[2].y),
                    new Vector3(tmpPath1[2].x, H + jgW, tmpPath1[2].y),
                    new Vector3(tmpPath1[1].x, H + jgW, tmpPath1[1].y)
                ]
                backface = [
                    new Vector3(tmpPath2[1].x, H, tmpPath2[1].y),
                    new Vector3(tmpPath2[2].x, H, tmpPath2[2].y),
                    new Vector3(tmpPath2[2].x, H + jgW, tmpPath2[2].y),
                    new Vector3(tmpPath2[1].x, H + jgW, tmpPath2[1].y)
                ]

                path = p_offsettype === 0 ? [
                    new Vector2(-p_offsetvalue, 0),
                    new Vector2(len - p_offsetvalue, 0),
                    new Vector2(len - p_offsetvalue, jgW),
                    new Vector2(-p_offsetvalue, jgW)
                ] : [
                    new Vector2(-len + W + p_offsetvalue, 0),
                    new Vector2(W + p_offsetvalue, 0),
                    new Vector2(W + p_offsetvalue, jgW),
                    new Vector2(-len + W + p_offsetvalue, jgW)
                ];

                vholes = []
                if (szk && szk.length > 0) {
                    for (i = 0; i < szk.length; i++) {
                        xv = p_offsettype === 0 ? -p_offsetvalue + len - Number(szk[i][0]) : -len + W + p_offsetvalue + Number(szk[i][0]);
                        yv = Number(szk[i][1]);

                        data.duan.push(xv * sinA + pos * cosA, yv + H, -xv * cosA + pos * sinA);

                        holePath = new Path()
                            .moveTo(xv, yv)
                            .absarc(xv, yv, kkzj / 2, 0, Math.PI * 2, true);

                        vholes.push(holePath);
                    }
                }

                count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, frontface, path, vholes,
                    (a: number, b: number) => [a * sinA + pos * cosA, b + H, -a * cosA + pos * sinA]);
                count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, backface, path, vholes,
                    (a: number, b: number) => [a * sinA + (pos - hjxchd) * cosA, b + H, -a * cosA + (pos - hjxchd) * sinA]);

                side = MoldUtils.getSideVIF([...backface, backface[0]], [...frontface, frontface[0]], count);
                vertices.push(...side[0]);
                indices.push(...side[1]);
                facevec.push(...side[2]);
                count = side[3];
            }
            else {
                // 水平
                frontface = [
                    new Vector3(tmpPath1[1].x, H + hjxchd, tmpPath1[1].y),
                    new Vector3(tmpPath1[2].x, H + hjxchd, tmpPath1[2].y),
                    new Vector3(tmpPath4[2].x, H + hjxchd, tmpPath4[2].y),
                    new Vector3(tmpPath4[1].x, H + hjxchd, tmpPath4[1].y)
                ]
                backface = [
                    new Vector3(tmpPath1[1].x, H, tmpPath1[1].y),
                    new Vector3(tmpPath1[2].x, H, tmpPath1[2].y),
                    new Vector3(tmpPath4[2].x, H, tmpPath4[2].y),
                    new Vector3(tmpPath4[1].x, H, tmpPath4[1].y)
                ]

                path = p_offsettype === 0 ? [
                    new Vector2(-p_offsetvalue, 0),
                    new Vector2(len - p_offsetvalue, 0),
                    new Vector2(len - p_offsetvalue, jgW),
                    new Vector2(-p_offsetvalue, jgW)
                ] : [
                    new Vector2(-len + W + p_offsetvalue, 0),
                    new Vector2(W + p_offsetvalue, 0),
                    new Vector2(W + p_offsetvalue, jgW),
                    new Vector2(-len + W + p_offsetvalue, jgW)
                ];

                sholes = [];
                if (spk && spk.length > 0) {
                    for (i = 0; i < spk.length; i++) {
                        xv = p_offsettype === 0 ? -p_offsetvalue + len - Number(spk[i][0]) : -len + W + p_offsetvalue + Number(spk[i][0]);
                        yv = Number(spk[i][1]);

                        data.duan.push(xv * sinA + (pos + yv) * cosA, H + hjxchd, (pos + yv) * sinA - xv * cosA);

                        holePath = new Path()
                            .moveTo(xv, yv)
                            .absarc(xv, yv, kkzj / 2, 0, Math.PI * 2, true);

                        sholes.push(holePath);
                    }
                }

                count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, frontface, path, sholes,
                    (a: number, b: number) => [a * sinA + (pos + b) * cosA, H + hjxchd, (pos + b) * sinA - a * cosA]);
                count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, backface, path, sholes,
                    (a: number, b: number) => [a * sinA + (pos + b) * cosA, H, (pos + b) * sinA - a * cosA]);

                side = MoldUtils.getSideVIF([...backface, backface[0]], [...frontface, frontface[0]], count);
                vertices.push(...side[0]);
                indices.push(...side[1]);
                facevec.push(...side[2]);
                count = side[3];

                // 竖直
                frontface = [
                    new Vector3(tmpPath1[1].x, H, tmpPath1[1].y),
                    new Vector3(tmpPath1[2].x, H, tmpPath1[2].y),
                    new Vector3(tmpPath1[2].x, H + jgW, tmpPath1[2].y),
                    new Vector3(tmpPath1[1].x, H + jgW, tmpPath1[1].y)
                ]
                backface = [
                    new Vector3(tmpPath3[1].x, H, tmpPath3[1].y),
                    new Vector3(tmpPath3[2].x, H, tmpPath3[2].y),
                    new Vector3(tmpPath3[2].x, H + jgW, tmpPath3[2].y),
                    new Vector3(tmpPath3[1].x, H + jgW, tmpPath3[1].y)
                ]

                path = p_offsettype === 0 ? [
                    new Vector2(-p_offsetvalue, 0),
                    new Vector2(len - p_offsetvalue, 0),
                    new Vector2(len - p_offsetvalue, jgW),
                    new Vector2(-p_offsetvalue, jgW)
                ] : [
                    new Vector2(-len + W + p_offsetvalue, 0),
                    new Vector2(W + p_offsetvalue, 0),
                    new Vector2(W + p_offsetvalue, jgW),
                    new Vector2(-len + W + p_offsetvalue, jgW)
                ];

                vholes = []
                if (szk && szk.length > 0) {
                    for (i = 0; i < szk.length; i++) {
                        xv = p_offsettype === 0 ? -p_offsetvalue + len - Number(szk[i][0]) : -len + W + p_offsetvalue + Number(szk[i][0]);
                        yv = Number(szk[i][1]);

                        data.duan.push(xv * sinA + pos * cosA, yv + H, -xv * cosA + pos * sinA);

                        holePath = new Path()
                            .moveTo(xv, yv)
                            .absarc(xv, yv, kkzj / 2, 0, Math.PI * 2, true);

                        vholes.push(holePath);
                    }
                }

                count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, frontface, path, vholes,
                    (a: number, b: number) => [a * sinA + pos * cosA, b + H, -a * cosA + pos * sinA]);
                count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, backface, path, vholes,
                    (a: number, b: number) => [a * sinA + (pos + hjxchd) * cosA, b + H, -a * cosA + (pos + hjxchd) * sinA]);

                side = MoldUtils.getSideVIF([...backface, backface[0]], [...frontface, frontface[0]], count);
                vertices.push(...side[0]);
                indices.push(...side[1]);
                facevec.push(...side[2]);
                count = side[3];
            }
        }
        else if (dir === 2) {

            if (lr === 1) {

                if (p_offsettype === 0) {
                    tmpPath1 = MoldUtils.getCornerPath(0, W, W, pos, L2, sinA, cosA);
                    tmpPath2 = MoldUtils.getCornerPath(0, W, W, pos - jgW, L2, sinA, cosA);
                    tmpPath3 = MoldUtils.getCornerPath(0, W + hjxchd, W + hjxchd, pos, L2, sinA, cosA);
                    tmpPath4 = MoldUtils.getCornerPath(0, W + hjxchd, W + hjxchd, pos - jgW, L2, sinA, cosA);
                }
                else {
                    tmpPath1 = MoldUtils.getCornerPath(0, 0, 0, pos, L2, sinA, cosA);
                    tmpPath2 = MoldUtils.getCornerPath(0, 0, 0, pos - jgW, L2, sinA, cosA);
                    tmpPath3 = MoldUtils.getCornerPath(0, -hjxchd, -hjxchd, pos, L2, sinA, cosA);
                    tmpPath4 = MoldUtils.getCornerPath(0, -hjxchd, -hjxchd, pos - jgW, L2, sinA, cosA);
                }

                // 水平
                frontface = [
                    new Vector3(tmpPath1[2].x, 0, tmpPath1[2].y),
                    new Vector3(tmpPath1[2].x, len, tmpPath1[2].y),
                    new Vector3(tmpPath2[2].x, len, tmpPath2[2].y),
                    new Vector3(tmpPath2[2].x, 0, tmpPath2[2].y)
                ]
                backface = [
                    new Vector3(tmpPath3[2].x, 0, tmpPath3[2].y),
                    new Vector3(tmpPath3[2].x, len, tmpPath3[2].y),
                    new Vector3(tmpPath4[2].x, len, tmpPath4[2].y),
                    new Vector3(tmpPath4[2].x, 0, tmpPath4[2].y)
                ]

                path = [
                    new Vector2(0, 0),
                    new Vector2(len, 0),
                    new Vector2(len, jgW),
                    new Vector2(0, jgW)
                ]

                sholes = [];
                if (spk && spk.length > 0) {
                    for (i = 0; i < spk.length; i++) {
                        xv = len - Number(spk[i][0]);
                        yv = Number(spk[i][1]);

                        data.duan.push((pos - yv) * cosA + (W + hjxchd) * sinA, xv, (pos - yv) * sinA - (W + hjxchd) * cosA);

                        holePath = new Path()
                            .moveTo(xv, yv)
                            .absarc(xv, yv, kkzj / 2, 0, Math.PI * 2, true);

                        sholes.push(holePath);
                    }
                }


                count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, frontface, path, sholes,
                    (a: number, b: number) => p_offsettype === 0 ? [(pos - b) * cosA + W * sinA, a, (pos - b) * sinA - W * cosA] :
                        [(pos - b) * cosA, a, (pos - b) * sinA]);
                count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, backface, path, sholes,
                    (a: number, b: number) => p_offsettype === 0 ? [(pos - b) * cosA + (W + hjxchd) * sinA, a, (pos - b) * sinA - (W + hjxchd) * cosA] :
                        [(pos - b) * cosA + (-hjxchd) * sinA, a, (pos - b) * sinA - (-hjxchd) * cosA]);

                side = MoldUtils.getSideVIF([...backface, backface[0]], [...frontface, frontface[0]], count);
                vertices.push(...side[0]);
                indices.push(...side[1]);
                facevec.push(...side[2]);
                count = side[3];

                // 竖直
                if (p_offsettype === 0) {
                    tmpPath1 = MoldUtils.getCornerPath(W, W + jgW, W + jgW, pos, L2, sinA, cosA);
                    tmpPath2 = MoldUtils.getCornerPath(W, W + jgW, W + jgW, pos - hjxchd, L2, sinA, cosA);
                }
                else {
                    tmpPath1 = MoldUtils.getCornerPath(-jgW, 0, 0, pos, L2, sinA, cosA);
                    tmpPath2 = MoldUtils.getCornerPath(-jgW, 0, 0, pos - hjxchd, L2, sinA, cosA);
                }

                frontface = [
                    new Vector3(tmpPath1[1].x, 0, tmpPath1[1].y),
                    new Vector3(tmpPath1[2].x, 0, tmpPath1[2].y),
                    new Vector3(tmpPath1[2].x, len, tmpPath1[2].y),
                    new Vector3(tmpPath1[1].x, len, tmpPath1[1].y)
                ]
                backface = [
                    new Vector3(tmpPath2[1].x, 0, tmpPath2[1].y),
                    new Vector3(tmpPath2[2].x, 0, tmpPath2[2].y),
                    new Vector3(tmpPath2[2].x, len, tmpPath2[2].y),
                    new Vector3(tmpPath2[1].x, len, tmpPath2[1].y)
                ]

                path = [
                    new Vector2(0, 0),
                    new Vector2(len, 0),
                    new Vector2(len, jgW),
                    new Vector2(0, jgW)
                ];

                vholes = []
                if (szk && szk.length > 0) {
                    for (i = 0; i < szk.length; i++) {
                        xv = len - Number(szk[i][0]);
                        yv = Number(szk[i][1]);

                        data.duan.push((W + yv) * sinA + pos * cosA, xv, pos * sinA - (W + yv) * cosA);

                        holePath = new Path()
                            .moveTo(xv, yv)
                            .absarc(xv, yv, kkzj / 2, 0, Math.PI * 2, true);

                        vholes.push(holePath);
                    }
                }


                count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, frontface, path, vholes,
                    (a: number, b: number) => p_offsettype === 0 ? [(W + b) * sinA + pos * cosA, a, pos * sinA - (W + b) * cosA] :
                        [(- b) * sinA + pos * cosA, a, pos * sinA - (- b) * cosA]);
                count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, backface, path, vholes,
                    (a: number, b: number) => p_offsettype === 0 ? [(W + b) * sinA + (pos - hjxchd) * cosA, a, (pos - hjxchd) * sinA - (W + b) * cosA] :
                        [(- b) * sinA + (pos - hjxchd) * cosA, a, (pos - hjxchd) * sinA - (-b) * cosA]);

                side = MoldUtils.getSideVIF([...backface, backface[0]], [...frontface, frontface[0]], count);
                vertices.push(...side[0]);
                indices.push(...side[1]);
                facevec.push(...side[2]);
                count = side[3];
            }
            else {

                if (p_offsettype === 0) {
                    tmpPath1 = MoldUtils.getCornerPath(0, W, W, pos, L2, sinA, cosA);
                    tmpPath2 = MoldUtils.getCornerPath(0, W, W, pos + jgW, L2, sinA, cosA);
                    tmpPath3 = MoldUtils.getCornerPath(0, W + hjxchd, W + hjxchd, pos, L2, sinA, cosA);
                    tmpPath4 = MoldUtils.getCornerPath(0, W + hjxchd, W + hjxchd, pos + jgW, L2, sinA, cosA);
                }
                else {
                    tmpPath1 = MoldUtils.getCornerPath(0, 0, 0, pos, L2, sinA, cosA);
                    tmpPath2 = MoldUtils.getCornerPath(0, 0, 0, pos + jgW, L2, sinA, cosA);
                    tmpPath3 = MoldUtils.getCornerPath(0, -hjxchd, -hjxchd, pos, L2, sinA, cosA);
                    tmpPath4 = MoldUtils.getCornerPath(0, -hjxchd, -hjxchd, pos + jgW, L2, sinA, cosA);
                }
                // 水平
                frontface = [
                    new Vector3(tmpPath1[2].x, 0, tmpPath1[2].y),
                    new Vector3(tmpPath1[2].x, len, tmpPath1[2].y),
                    new Vector3(tmpPath2[2].x, len, tmpPath2[2].y),
                    new Vector3(tmpPath2[2].x, 0, tmpPath2[2].y)
                ]
                backface = [
                    new Vector3(tmpPath3[2].x, 0, tmpPath3[2].y),
                    new Vector3(tmpPath3[2].x, len, tmpPath3[2].y),
                    new Vector3(tmpPath4[2].x, len, tmpPath4[2].y),
                    new Vector3(tmpPath4[2].x, 0, tmpPath4[2].y)
                ]

                path = [
                    new Vector2(0, 0),
                    new Vector2(len, 0),
                    new Vector2(len, jgW),
                    new Vector2(0, jgW)
                ];

                sholes = [];
                if (spk && spk.length > 0) {
                    for (i = 0; i < spk.length; i++) {
                        xv = len - Number(spk[i][0]);
                        yv = Number(spk[i][1]);

                        data.duan.push((pos + yv) * cosA + W * sinA, xv, (pos + yv) * sinA - W * cosA);

                        holePath = new Path()
                            .moveTo(xv, yv)
                            .absarc(xv, yv, kkzj / 2, 0, Math.PI * 2, true);

                        sholes.push(holePath);
                    }
                }

                count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, frontface, path, sholes,
                    (a: number, b: number) => p_offsettype === 0 ? [(pos + b) * cosA + W * sinA, a, (pos + b) * sinA - W * cosA] :
                        [(pos + b) * cosA, a, (pos + b) * sinA]);
                count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, backface, path, sholes,
                    (a: number, b: number) => p_offsettype === 0 ? [(pos + b) * cosA + (W + hjxchd) * sinA, a, (pos + b) * sinA - (W + hjxchd) * cosA] :
                        [(pos + b) * cosA + (- hjxchd) * sinA, a, (pos + b) * sinA - (- hjxchd) * cosA]);

                side = MoldUtils.getSideVIF([...backface, backface[0]], [...frontface, frontface[0]], count);
                vertices.push(...side[0]);
                indices.push(...side[1]);
                facevec.push(...side[2]);
                count = side[3];

                // 竖直
                if (p_offsettype === 0) {
                    tmpPath1 = MoldUtils.getCornerPath(W, W + jgW, W + jgW, pos, L2, sinA, cosA);
                    tmpPath2 = MoldUtils.getCornerPath(W, W + jgW, W + jgW, pos + hjxchd, L2, sinA, cosA);
                }
                else {
                    tmpPath1 = MoldUtils.getCornerPath(-jgW, 0, 0, pos, L2, sinA, cosA);
                    tmpPath2 = MoldUtils.getCornerPath(-jgW, 0, 0, pos + hjxchd, L2, sinA, cosA);
                }

                frontface = [
                    new Vector3(tmpPath1[1].x, 0, tmpPath1[1].y),
                    new Vector3(tmpPath1[2].x, 0, tmpPath1[2].y),
                    new Vector3(tmpPath1[2].x, len, tmpPath1[2].y),
                    new Vector3(tmpPath1[1].x, len, tmpPath1[1].y)
                ]
                backface = [
                    new Vector3(tmpPath2[1].x, 0, tmpPath2[1].y),
                    new Vector3(tmpPath2[2].x, 0, tmpPath2[2].y),
                    new Vector3(tmpPath2[2].x, len, tmpPath2[2].y),
                    new Vector3(tmpPath2[1].x, len, tmpPath2[1].y)
                ]

                path = [
                    new Vector2(0, 0),
                    new Vector2(len, 0),
                    new Vector2(len, jgW),
                    new Vector2(0, jgW)
                ];

                vholes = []
                if (szk && szk.length > 0) {
                    for (i = 0; i < szk.length; i++) {
                        xv = len - Number(szk[i][0]);
                        yv = Number(szk[i][1]);

                        data.duan.push((W + yv) * sinA + pos * cosA, xv, pos * sinA - (W + yv) * cosA);

                        holePath = new Path()
                            .moveTo(xv, yv)
                            .absarc(xv, yv, kkzj / 2, 0, Math.PI * 2, true);

                        vholes.push(holePath);
                    }
                }


                count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, frontface, path, vholes,
                    (a: number, b: number) => p_offsettype === 0 ? [(W + b) * sinA + pos * cosA, a, pos * sinA - (W + b) * cosA] :
                        [(- b) * sinA + pos * cosA, a, pos * sinA - (- b) * cosA]);
                count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, backface, path, vholes,
                    (a: number, b: number) => p_offsettype === 0 ? [(W + b) * sinA + (pos + hjxchd) * cosA, a, (pos + hjxchd) * sinA - (W + b) * cosA] :
                        [(- b) * sinA + (pos + hjxchd) * cosA, a, (pos + hjxchd) * sinA - (- b) * cosA]);

                side = MoldUtils.getSideVIF([...backface, backface[0]], [...frontface, frontface[0]], count);
                vertices.push(...side[0]);
                indices.push(...side[1]);
                facevec.push(...side[2]);
                count = side[3];
            }
        }
        else if (dir === 3) {

            tmpPath1 = MoldUtils.getCornerPath(0, W, W, pos, L2, sinA, cosA);
            tmpPath2 = MoldUtils.getCornerPath(0, W, W, pos + jgW, L2, sinA, cosA);
            tmpPath3 = MoldUtils.getCornerPath(0, W + hjxchd, W + hjxchd, pos, L2, sinA, cosA);
            tmpPath4 = MoldUtils.getCornerPath(0, W + hjxchd, W + hjxchd, pos + jgW, L2, sinA, cosA);
            // 水平
            frontface = [
                new Vector3(tmpPath1[2].x, 0, tmpPath1[2].y),
                new Vector3(tmpPath1[2].x, len, tmpPath1[2].y),
                new Vector3(tmpPath2[2].x, len, tmpPath2[2].y),
                new Vector3(tmpPath2[2].x, 0, tmpPath2[2].y)
            ]
            backface = [
                new Vector3(tmpPath3[2].x, 0, tmpPath3[2].y),
                new Vector3(tmpPath3[2].x, len, tmpPath3[2].y),
                new Vector3(tmpPath4[2].x, len, tmpPath4[2].y),
                new Vector3(tmpPath4[2].x, 0, tmpPath4[2].y)
            ]

            path = [
                new Vector2(0, 0),
                new Vector2(len, 0),
                new Vector2(len, jgW),
                new Vector2(0, jgW)
            ];

            sholes = [];
            if (spk && spk.length > 0) {
                for (i = 0; i < spk.length; i++) {
                    xv = len - Number(spk[i][0]);
                    yv = Number(spk[i][1]);

                    data.duan.push((pos + yv) * cosA + (W + hjxchd) * sinA, xv, (pos + yv) * sinA - (W + hjxchd) * cosA);

                    holePath = new Path()
                        .moveTo(xv, yv)
                        .absarc(xv, yv, kkzj / 2, 0, Math.PI * 2, true);

                    sholes.push(holePath);
                }
            }


            count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, frontface, path, sholes,
                (a: number, b: number) => [(pos + b) * cosA + W * sinA, a, (pos + b) * sinA - W * cosA]);
            count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, backface, path, sholes,
                (a: number, b: number) => [(pos + b) * cosA + (W + hjxchd) * sinA, a, (pos + b) * sinA - (W + hjxchd) * cosA]);

            side = MoldUtils.getSideVIF([...backface, backface[0]], [...frontface, frontface[0]], count);
            vertices.push(...side[0]);
            indices.push(...side[1]);
            facevec.push(...side[2]);
            count = side[3];

            // 竖直
            tmpPath1 = MoldUtils.getCornerPath(W, W + jgW, W + jgW, pos, L2, sinA, cosA);
            tmpPath2 = MoldUtils.getCornerPath(W, W + jgW, W + jgW, pos + jgW, L2, sinA, cosA);

            frontface = [
                new Vector3(tmpPath1[1].x, len, tmpPath1[1].y),
                new Vector3(tmpPath1[2].x, len, tmpPath1[2].y),
                new Vector3(tmpPath2[2].x, len, tmpPath2[2].y),
                new Vector3(tmpPath2[1].x, len, tmpPath2[1].y)
            ]
            backface = [
                new Vector3(tmpPath1[1].x, len - hjxchd, tmpPath1[1].y),
                new Vector3(tmpPath1[2].x, len - hjxchd, tmpPath1[2].y),
                new Vector3(tmpPath2[2].x, len - hjxchd, tmpPath2[2].y),
                new Vector3(tmpPath2[1].x, len - hjxchd, tmpPath2[1].y)
            ]

            path = [
                new Vector2(0, 0),
                new Vector2(jgW, 0),
                new Vector2(jgW, jgW),
                new Vector2(0, jgW)
            ];

            vholes = []
            if (szk && szk.length > 0) {
                for (i = 0; i < szk.length; i++) {
                    xv = jgW - Number(szk[i][0]);
                    yv = Number(szk[i][1]);

                    data.duan.push((xv + W) * sinA + (pos + yv) * cosA, len, (pos + yv) * sinA - (xv + W) * cosA);

                    holePath = new Path()
                        .moveTo(xv, yv)
                        .absarc(xv, yv, kkzj / 2, 0, Math.PI * 2, true);

                    vholes.push(holePath);
                }
            }

            count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, frontface, path, vholes,
                (a: number, b: number) => [(a + W) * sinA + (pos + b) * cosA, len, (pos + b) * sinA - (a + W) * cosA]);
            count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, backface, path, vholes,
                (a: number, b: number) => [(a + W) * sinA + (pos + b) * cosA, len - hjxchd, (pos + b) * sinA - (a + W) * cosA]);

            side = MoldUtils.getSideVIF([...backface, backface[0]], [...frontface, frontface[0]], count);
            vertices.push(...side[0]);
            indices.push(...side[1]);
            facevec.push(...side[2]);
            count = side[3];

        }
        else if (dir === 4) {

            if (lr === 1) {
                if (p_offsettype === 0) {
                    tmpPath1 = MoldUtils.getCornerPath(0, hjxchd, hjxchd, pos, L2, sinA, cosA);
                    tmpPath2 = MoldUtils.getCornerPath(0, hjxchd, hjxchd, pos - jgW, L2, sinA, cosA);
                }
                else {
                    tmpPath1 = MoldUtils.getCornerPath(W - hjxchd, W, W, pos, L2, sinA, cosA);
                    tmpPath2 = MoldUtils.getCornerPath(W - hjxchd, W, W, pos - jgW, L2, sinA, cosA);
                }

                // 水平
                frontface = [
                    new Vector3(tmpPath1[1].x, H, tmpPath1[1].y),
                    new Vector3(tmpPath1[1].x, H + len, tmpPath1[1].y),
                    new Vector3(tmpPath2[1].x, H + len, tmpPath2[1].y),
                    new Vector3(tmpPath2[1].x, H, tmpPath2[1].y)
                ]
                backface = [
                    new Vector3(tmpPath1[2].x, H, tmpPath1[2].y),
                    new Vector3(tmpPath1[2].x, H + len, tmpPath1[2].y),
                    new Vector3(tmpPath2[2].x, H + len, tmpPath2[2].y),
                    new Vector3(tmpPath2[2].x, H, tmpPath2[2].y)
                ]

                path = [
                    new Vector2(0, 0),
                    new Vector2(len, 0),
                    new Vector2(len, jgW),
                    new Vector2(0, jgW)
                ];

                sholes = [];
                if (spk && spk.length > 0) {
                    for (i = 0; i < spk.length; i++) {
                        xv = len - Number(spk[i][0]);
                        yv = Number(spk[i][1]);

                        data.duan.push((pos - yv) * cosA + hjxchd * sinA, H + xv, (pos - yv) * sinA - hjxchd * cosA);

                        holePath = new Path()
                            .moveTo(xv, yv)
                            .absarc(xv, yv, kkzj / 2, 0, Math.PI * 2, true);

                        sholes.push(holePath);
                    }
                }

                count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, frontface, path, sholes,
                    (a: number, b: number) => p_offsettype === 0 ? [(pos - b) * cosA, H + a, (pos - b) * sinA] :
                        [(pos - b) * cosA + W * sinA, H + a, (pos - b) * sinA - W * cosA]);
                count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, backface, path, sholes,
                    (a: number, b: number) => p_offsettype === 0 ? [(pos - b) * cosA + hjxchd * sinA, H + a, (pos - b) * sinA - hjxchd * cosA] :
                        [(pos - b) * cosA + (W - hjxchd) * sinA, H + a, (pos - b) * sinA - (W - hjxchd) * cosA]);

                side = MoldUtils.getSideVIF([...backface, backface[0]], [...frontface, frontface[0]], count);
                vertices.push(...side[0]);
                indices.push(...side[1]);
                facevec.push(...side[2]);
                count = side[3];

                // 竖直
                if (p_offsettype === 0) {
                    tmpPath1 = MoldUtils.getCornerPath(0, jgW, jgW, pos, L2, sinA, cosA);
                    tmpPath2 = MoldUtils.getCornerPath(0, jgW, jgW, pos - hjxchd, L2, sinA, cosA);
                }
                else {
                    tmpPath1 = MoldUtils.getCornerPath(W - jgW, W, W, pos, L2, sinA, cosA);
                    tmpPath2 = MoldUtils.getCornerPath(W - jgW, W, W, pos - hjxchd, L2, sinA, cosA);
                }

                frontface = [
                    new Vector3(tmpPath1[1].x, H, tmpPath1[1].y),
                    new Vector3(tmpPath1[2].x, H, tmpPath1[2].y),
                    new Vector3(tmpPath1[2].x, H + len, tmpPath1[2].y),
                    new Vector3(tmpPath1[1].x, H + len, tmpPath1[1].y)
                ]
                backface = [
                    new Vector3(tmpPath2[1].x, H, tmpPath2[1].y),
                    new Vector3(tmpPath2[2].x, H, tmpPath2[2].y),
                    new Vector3(tmpPath2[2].x, H + len, tmpPath2[2].y),
                    new Vector3(tmpPath2[1].x, H + len, tmpPath2[1].y)
                ]

                path = p_offsettype === 0 ? [
                    new Vector2(0, 0),
                    new Vector2(len, 0),
                    new Vector2(len, jgW),
                    new Vector2(0, jgW)
                ] : [
                    new Vector2(0, W - jgW),
                    new Vector2(len, W - jgW),
                    new Vector2(len, W),
                    new Vector2(0, W)
                ]

                vholes = []
                if (szk && szk.length > 0) {
                    for (i = 0; i < szk.length; i++) {
                        xv = len - Number(szk[i][0]);
                        yv = p_offsettype === 0 ? Number(szk[i][1]) : W - Number(szk[i][1]);

                        data.duan.push(yv * sinA + pos * cosA, xv + H, pos * sinA - yv * cosA);

                        holePath = new Path()
                            .moveTo(xv, yv)
                            .absarc(xv, yv, kkzj / 2, 0, Math.PI * 2, true);

                        vholes.push(holePath);
                    }
                }

                count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, frontface, path, vholes,
                    (a: number, b: number) => [b * sinA + pos * cosA, a + H, pos * sinA - b * cosA]);
                count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, backface, path, vholes,
                    (a: number, b: number) => [b * sinA + (pos - hjxchd) * cosA, a + H, (pos - hjxchd) * sinA - b * cosA]);

                side = MoldUtils.getSideVIF([...backface, backface[0]], [...frontface, frontface[0]], count);
                vertices.push(...side[0]);
                indices.push(...side[1]);
                facevec.push(...side[2]);
                count = side[3];
            }
            else {


                if (p_offsettype === 0) {
                    tmpPath1 = MoldUtils.getCornerPath(0, hjxchd, hjxchd, pos, L2, sinA, cosA);
                    tmpPath2 = MoldUtils.getCornerPath(0, hjxchd, hjxchd, pos + jgW, L2, sinA, cosA);
                }
                else {
                    tmpPath1 = MoldUtils.getCornerPath(W - hjxchd, W, W, pos, L2, sinA, cosA);
                    tmpPath2 = MoldUtils.getCornerPath(W - hjxchd, W, W, pos + jgW, L2, sinA, cosA);
                }
                // 水平
                frontface = [
                    new Vector3(tmpPath1[1].x, H, tmpPath1[1].y),
                    new Vector3(tmpPath1[1].x, H + len, tmpPath1[1].y),
                    new Vector3(tmpPath2[1].x, H + len, tmpPath2[1].y),
                    new Vector3(tmpPath2[1].x, H, tmpPath2[1].y)
                ]
                backface = [
                    new Vector3(tmpPath1[2].x, H, tmpPath1[2].y),
                    new Vector3(tmpPath1[2].x, H + len, tmpPath1[2].y),
                    new Vector3(tmpPath2[2].x, H + len, tmpPath2[2].y),
                    new Vector3(tmpPath2[2].x, H, tmpPath2[2].y)
                ]

                path = [
                    new Vector2(0, 0),
                    new Vector2(len, 0),
                    new Vector2(len, jgW),
                    new Vector2(0, jgW)
                ];

                sholes = [];
                if (spk && spk.length > 0) {
                    for (i = 0; i < spk.length; i++) {
                        xv = len - Number(spk[i][0]);
                        yv = Number(spk[i][1]);

                        data.duan.push((pos + yv) * cosA + hjxchd * sinA, H + xv, (pos + yv) * sinA - hjxchd * cosA);

                        holePath = new Path()
                            .moveTo(xv, yv)
                            .absarc(xv, yv, kkzj / 2, 0, Math.PI * 2, true);

                        sholes.push(holePath);
                    }
                }

                count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, frontface, path, sholes,
                    (a: number, b: number) => p_offsettype === 0 ? [(pos + b) * cosA, H + a, (pos + b) * sinA] :
                        [(pos + b) * cosA + W * sinA, H + a, (pos + b) * sinA - W * cosA]);
                count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, backface, path, sholes,
                    (a: number, b: number) => p_offsettype === 0 ? [(pos + b) * cosA + hjxchd * sinA, H + a, (pos + b) * sinA - hjxchd * cosA] :
                        [(pos + b) * cosA + (W - hjxchd) * sinA, H + a, (pos + b) * sinA - (W - hjxchd) * cosA]);

                side = MoldUtils.getSideVIF([...backface, backface[0]], [...frontface, frontface[0]], count);
                vertices.push(...side[0]);
                indices.push(...side[1]);
                facevec.push(...side[2]);
                count = side[3];

                // 竖直
                if (p_offsettype === 0) {
                    tmpPath1 = MoldUtils.getCornerPath(0, jgW, jgW, pos, L2, sinA, cosA);
                    tmpPath2 = MoldUtils.getCornerPath(0, jgW, jgW, pos + hjxchd, L2, sinA, cosA);
                }
                else {
                    tmpPath1 = MoldUtils.getCornerPath(W - jgW, W, W, pos, L2, sinA, cosA);
                    tmpPath2 = MoldUtils.getCornerPath(W - jgW, W, W, pos + hjxchd, L2, sinA, cosA);
                }


                frontface = [
                    new Vector3(tmpPath1[1].x, H, tmpPath1[1].y),
                    new Vector3(tmpPath1[2].x, H, tmpPath1[2].y),
                    new Vector3(tmpPath1[2].x, H + len, tmpPath1[2].y),
                    new Vector3(tmpPath1[1].x, H + len, tmpPath1[1].y)
                ]
                backface = [
                    new Vector3(tmpPath2[1].x, H, tmpPath2[1].y),
                    new Vector3(tmpPath2[2].x, H, tmpPath2[2].y),
                    new Vector3(tmpPath2[2].x, H + len, tmpPath2[2].y),
                    new Vector3(tmpPath2[1].x, H + len, tmpPath2[1].y)
                ]

                path = p_offsettype === 0 ? [
                    new Vector2(0, 0),
                    new Vector2(len, 0),
                    new Vector2(len, jgW),
                    new Vector2(0, jgW)
                ] : [
                    new Vector2(0, W - jgW),
                    new Vector2(len, W - jgW),
                    new Vector2(len, W),
                    new Vector2(0, W)
                ]


                vholes = []
                if (szk && szk.length > 0) {
                    for (i = 0; i < szk.length; i++) {
                        xv = len - Number(szk[i][0]);
                        yv = p_offsettype === 0 ? Number(szk[i][1]) : W - Number(szk[i][1]);

                        data.duan.push(yv * sinA + pos * cosA, xv + H, pos * sinA - yv * cosA);

                        holePath = new Path()
                            .moveTo(xv, yv)
                            .absarc(xv, yv, kkzj / 2, 0, Math.PI * 2, true);

                        vholes.push(holePath);
                    }
                }

                count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, frontface, path, vholes,
                    (a: number, b: number) => [b * sinA + pos * cosA, a + H, pos * sinA - b * cosA]);
                count = IronUtils.getFaceByFunction(count, vertices, indices, facevec, backface, path, vholes,
                    (a: number, b: number) => [b * sinA + (pos + hjxchd) * cosA, a + H, (pos + hjxchd) * sinA - b * cosA]);

                side = MoldUtils.getSideVIF([...backface, backface[0]], [...frontface, frontface[0]], count);
                vertices.push(...side[0]);
                indices.push(...side[1]);
                facevec.push(...side[2]);
                count = side[3];
            }
        }


        return count;
    }

    static getCornerWeldPos(zw: number, zyl: number, sinA: number, cosA: number): number[] {
        return [zw * sinA + zyl * cosA, zyl * sinA - zw * cosA];
    }


    /**
     * 获取孔径
     * @param strAry 孔位置:25,1000,25
     * @param kkzj 孔直径
     * @param kj 孔径
     * @returns 
     */
    static getKjAry(strAry: string[], kkzj: number, kj: string): string[] {
        let kjstr: string[];
        let str: string[] = [];
        kjstr = kj.toString().split(',');
        for (let i = 0; i < strAry.length; i++) {
            if (kjstr[i] && kjstr[i] != '') {
                str.push(isNaN(parseFloat(kjstr[i])) ? kkzj.toString() : parseFloat(kjstr[i]).toString())
            }
            else {
                str.push(kkzj.toString())
            }
        }

        return str;
    }

    /**
    * 普通角钢
    * @param data 
    * @returns 
    */
    static getAngleIronVI(data: ALParams): any[] {
        // 数据
        let vertices: any[] = [];
        let indices: any[] = [];
        let facevec: any[] = [];
        let count: number = 0;

        // 后台数据
        let L: number = Number(data.L);
        let tphd: number = Number(data.tphd);
        let bkkjjcm_dis: number = Number(data.BKKJMDis);
        let kkzj: number = Number(data.kkzj);
        let jgW: number = Number(data.jgW);

        // 临时变量
        let path: Vector2[];
        let holePath: Path;
        let holes: Path[];
        let i: number, xv: number, yv: number;

        data.duan = [
            0, 0, 0,
            L, 0, 0
        ]

        data.zhong = {
            RL: [
                {
                    pointer: [0, jgW / 2, 0],
                    center: [L / 2, jgW / 2, 0]
                }
            ],
            L: [
                {
                    pointer: [L, jgW / 2, 0],
                    center: [L / 2, jgW / 2, 0]
                }
            ]
        }

        data.kong = [];

        // 水平
        path = [
            new Vector2(0, 0),
            new Vector2(0, jgW),
            new Vector2(L, jgW),
            new Vector2(L, 0)
        ];
        holes = []

        let kwAry = AModelFmulaUtils.getHolesbyExpress(data[AK.p_zykw], L, 2, data, AK.p_zykw, 10008);

        // let strAry = data[AK.p_zykw].split(',');

        let str: string[] = IronUtils.getKjAry(kwAry, kkzj, data[AK.p_zykj]);
        data[AK.p_zykj] = str.join(',');

        if (kwAry.length > 0) {
            xv = 0;
            for (i = 0; i < kwAry.length; i++) {
                xv = Number(kwAry[i]);
                yv = bkkjjcm_dis;

                data.duan.push(xv, 0, yv);
                data.kong.push(xv, 0, yv);

                holePath = new Path();
                holePath.moveTo(xv, yv)
                    .absarc(xv, yv, Number(str[i]) / 2, 0, Math.PI * 2, true);

                holes.push(holePath);
            }
        }
        count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 2, 0, tphd, false);

        // 垂直
        path = [
            new Vector2(0, 0),
            new Vector2(L, 0),
            new Vector2(L, jgW),
            new Vector2(0, jgW)
        ];
        holes = [];
        kwAry = AModelFmulaUtils.getHolesbyExpress(data[AK.p_yykw], L, 2, data, AK.p_yykw, 10008);
        // strAry = data[AK.p_yykw].split(',')
        str = IronUtils.getKjAry(kwAry, kkzj, data[AK.p_yykj]);
        data[AK.p_yykj] = str.join(',');

        if (kwAry.length > 0) {
            xv = 0;
            for (i = 0; i < kwAry.length; i++) {
                xv = Number(kwAry[i]);
                yv = bkkjjcm_dis;

                data.duan.push(xv, yv, 0);

                holePath = new Path();
                holePath.moveTo(xv, yv)
                    .absarc(xv, yv, Number(str[i]) / 2, 0, Math.PI * 2, true);

                holes.push(holePath);
            }
        }
        count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 0, 0, tphd, false);

        // 焊接件
        let p = data.p_hjwz;
        let posinfo = [];
        let dataAry = p.split(')');
        let jgdata: string[];
        let truedata: string[]
        for (let jg of dataAry) {
            jgdata = jg.split('(');
            for (let jgary of jgdata) {
                if (jgary !== '') {
                    truedata = jgary.split(',');
                    posinfo.push(truedata);
                }
            }
        }

        // 焊接位置信息
        let pos: number, len: number, zy: number;
        for (let pifo of posinfo) {
            pos = Number(pifo[0]);
            len = Number(pifo[1]);
            zy = Number(pifo[2]);

            // 空值不生成
            if (isNaN(pos) || isNaN(len) || isNaN(zy)) continue;

            // 根据位置生成焊接件
            count = IronUtils.getIronWeldVI(count, vertices, indices, facevec, jgW, tphd, pos, len, zy);

        }
        return [vertices, indices, facevec];
    }

    /**
     * 获取普通角钢的焊接件
     * @param count 
     * @param vertices 
     * @param indices 
     * @param facevec 
     * @param pos 位置
     * @param len 长度
     * @param zy 0 左 1 右
     * @param jgW 角钢宽度
     */
    static getIronWeldVI(count: number, vertices: number[], indices: number[], facevec: Vector3[][], jgW: number, tphd: number, pos: number, len: number, zy: number): number {


        if (zy === 1) {
            // 水平
            count = MoldUtils.getCuboidVI(count, vertices, indices, facevec, pos, pos + jgW, -len, 0, 0, tphd);
            // 垂直
            count = MoldUtils.getCuboidVI(count, vertices, indices, facevec, pos, pos + tphd, -len, 0, 0, jgW);
        }
        else {
            // 水平
            count = MoldUtils.getCuboidVI(count, vertices, indices, facevec, pos, pos + jgW, -len, 0, 0, tphd);
            // 垂直
            count = MoldUtils.getCuboidVI(count, vertices, indices, facevec, pos + jgW - tphd, pos + jgW, -len, 0, 0, jgW);
        }


        return count;
    }


    /**
    * 7字形角钢
    * @param data 
    * @returns 
    */
    static getQiAngleIronVI(data: ALParams): any[] {
        // 数据
        let vertices: any[] = [];
        let indices: any[] = [];
        let facevec: any[] = [];
        // 计数
        let count: number = 0;

        let L: number = Number(data.L);
        let H: number = Number(data.H);
        let tphd: number = Number(data.tphd);
        let bkkjjcm_dis: number = Number(data.BKKJMDis);
        let kkzj: number = Number(data.kkzj);
        let jgW: number = Number(data.jgW);

        let path: Vector2[];
        let holePath: Path;
        let holes: Path[];
        let i: number, xv: number, yv: number;

        // 0 左侧 1 右侧
        let zy = Number(data.p_lrtype);

        let zval = zy === 0 ? 0 : -jgW;
        data.duan = [
            0, 0, zval,
            L, 0, zval,
            L, -H, zval
        ];
        data.zhong = {
            RL: [
                {
                    pointer: [0, jgW / 2, zval],
                    center: [L / 2, jgW / 2, zval]
                }
            ],
            H: [
                {
                    pointer: [L + jgW / 2, -H, zval],
                    center: [L + jgW / 2, -H / 2, zval]
                }
            ]
        }

        data.kong = []

        // 水平
        path = [
            new Vector2(0, 0),
            new Vector2(L + jgW, 0),
            new Vector2(L + jgW, -jgW),
            new Vector2(0, -jgW)
        ]
        // path = zy === 0 ? [
        //     new Vector2(0, 0),
        //     new Vector2(L, 0),
        //     new Vector2(L, -jgW),
        //     new Vector2(0, -jgW)

        // ] 
        // : [
        //     new Vector2(0, 0),
        //     new Vector2(0, jgW),
        //     new Vector2(L, jgW),
        //     new Vector2(L, 0)
        // ];
        holes = []
        // let strAry = data[AK.p_spkw].split(',')
        let kwAry = AModelFmulaUtils.getHolesbyExpress(data[AK.p_spkw], L + jgW, 2, data, AK.p_spkw, 10008);
        if (kwAry.length > 0) {
            xv = 0;
            for (i = 0; i < kwAry.length; i++) {
                xv = Number(kwAry[i]);
                yv = zy === 0 ? -bkkjjcm_dis : -jgW + bkkjjcm_dis;

                data.duan.push(xv, 0, yv);
                data.kong.push(xv, 0, yv);

                holePath = new Path();
                holePath.moveTo(xv, yv)
                    .absarc(xv, yv, kkzj / 2, 0, Math.PI * 2, true);

                holes.push(holePath);
            }
        }
        count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 2, 0, tphd, false);

        // 垂直
        path = [
            new Vector2(0, 0),
            new Vector2(L + jgW, 0),
            new Vector2(L + jgW, jgW),
            new Vector2(0, jgW)
        ];
        holes = [];
        // strAry = data[AK.p_szkw].split(',')
        kwAry = AModelFmulaUtils.getHolesbyExpress(data[AK.p_szkw], L + jgW, 2, data, AK.p_szkw, 10008);
        if (kwAry.length > 0) {
            xv = 0;
            for (i = 0; i < kwAry.length; i++) {
                xv = Number(kwAry[i]);
                yv = bkkjjcm_dis;

                data.duan.push(xv, yv, zval)

                holePath = new Path();
                holePath.moveTo(xv, yv)
                    .absarc(xv, yv, kkzj / 2, 0, Math.PI * 2, true);

                holes.push(holePath);
            }
        }

        if (zy === 0) {
            count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 0, 0, -tphd, false);
        }
        else {
            count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 0, -jgW, -jgW + tphd, false);
        }


        // 下部角
        if (zy === 1) {
            // 水平
            count = MoldUtils.getCuboidVI(count, vertices, indices, facevec, L, L + jgW, -H, jgW, -jgW - tphd, -jgW);
            // 垂直
            count = MoldUtils.getCuboidVI(count, vertices, indices, facevec, L, L + tphd, -H, jgW, -2 * jgW, -jgW);
        }
        else {
            // 水平
            count = MoldUtils.getCuboidVI(count, vertices, indices, facevec, L, L + jgW, -H, jgW, 0, tphd);
            // 垂直
            count = MoldUtils.getCuboidVI(count, vertices, indices, facevec, L, L + tphd, -H, jgW, 0, jgW);
        }

        return [vertices, indices, facevec];
    }


    /**
    * Z字形角钢
    * @param data 
    * @returns 
    */
    static getZAngleIronVI(data: ALParams): any[] {

        // 数据
        let vertices: any[] = [];
        let indices: any[] = [];
        let facevec: any[] = [];
        // 计数
        let count: number = 0;

        // 参数
        let L1: number = Number(data.L1);
        let L2: number = Number(data.L2);
        let H: number = Number(data.H);
        let fghd: number = Number(data.fghd);
        let tphd: number = Number(data.tphd);
        let jgW: number = Number(data.jgW);
        let kkzj: number = Number(data.kkzj);
        let BKKJMDis: number = Number(data.BKKJMDis);
        let fgW: number = Number(data.fgW);
        let fgH: number = Number(data.fgH);;

        let dbtg: number = Number(data.p_dbtg);

        // 参数
        let path: Vector2[];
        let holePath: Path;
        let holes: Path[];
        let i: number, xv: number, yv: number;

        // 方管：0 有 1 无
        let fg = Number(data.p_create);

        // 0 左侧 1 右侧
        let zy = Number(data.p_lrtype);

        let zval = zy === 0 ? 0 : jgW;
        // 上
        if (fg === 0) {
            data.duan = [
                0, H - jgW, zval,
                L1, H - jgW, zval,
                L1, 0, zval,
                L1 + L2 + fgW, dbtg, zval
            ]

            data.zhong = {
                RL1: [
                    {
                        pointer: [0, H - jgW, jgW / 2],
                        center: [L1 / 2, H - jgW, jgW / 2]
                    }
                ],
                L1: [
                    {
                        pointer: [L1, H - jgW, jgW / 2],
                        center: [L1 / 2, H - jgW, jgW / 2]
                    }
                ],

                RH: [
                    {
                        pointer: [L1 + fgW / 2, 0, zval],
                        center: [L1 + fgW / 2, H / 2, zval]
                    }
                ],
                H: [
                    {
                        pointer: [L1 + fgW / 2, H, zval],
                        center: [L1 + fgW / 2, H / 2, zval]
                    }
                ],
                RL2: [
                    {
                        pointer: [L1 + fgW, dbtg, jgW / 2],
                        center: [L1 + fgW + L2 / 2, dbtg, jgW / 2]
                    }
                ],
                L2: [
                    {
                        pointer: [L1 + L2 + fgW, dbtg, jgW / 2],
                        center: [L1 + fgW + L2 / 2, dbtg, jgW / 2]
                    }
                ],
            }
        }
        else {
            data.duan = [
                0, H, zval,
                L1, H, zval,
                L1, 0, zval,
                L1 + L2, dbtg, zval
            ]

            data.zhong = {
                RL1: [
                    {
                        pointer: [0, H, jgW / 2],
                        center: [L1 / 2, H, jgW / 2]
                    }
                ],
                L1: [
                    {
                        pointer: [L1 - jgW, H, 0],
                        center: [L1 / 2, H, 0]
                    }
                ],

                RH: [
                    {
                        pointer: [L1 - jgW / 2, 0, zval],
                        center: [L1 - jgW / 2, H / 2, zval]
                    }
                ],
                H: [
                    {
                        pointer: [L1 - jgW / 2, H, zval],
                        center: [L1 - jgW / 2, H / 2, zval]
                    }
                ],
                RL2: [
                    {
                        pointer: [L1 - jgW, dbtg, 0],
                        center: [L1 + L2 / 2, dbtg, 0]
                    }
                ],
                L2: [
                    {
                        pointer: [L1 + L2, dbtg, jgW / 2],
                        center: [L1 + L2 / 2, dbtg, jgW / 2]
                    }
                ],
            }
        }

        data.kong = [];

        // 水平
        path = [
            new Vector2(0, 0),
            new Vector2(0, jgW),
            new Vector2(L1, jgW),
            new Vector2(L1, 0)
        ]
        // path = zy === 0 ? [
        //     new Vector2(0, 0),
        //     new Vector2(0, jgW),
        //     new Vector2(L1, jgW),
        //     new Vector2(L1, 0)
        // ] : [
        //     new Vector2(0, 0),
        //     new Vector2(0, -jgW),
        //     new Vector2(L1, -jgW),
        //     new Vector2(L1, 0)
        // ];


        holes = [];
        // let strAry = data[AK.p_skspkw].split(',')

        let kwAry = AModelFmulaUtils.getHolesbyExpress(data[AK.p_skspkw], L1, 2, data, AK.p_skspkw, 10008);

        let str = IronUtils.getKjAry(kwAry, kkzj, data[AK.p_skspkj]);
        data[AK.p_skspkj] = str.join(',');

        if (kwAry.length > 0) {
            xv = 0;
            for (i = 0; i < kwAry.length; i++) {
                xv = Number(kwAry[i]);
                yv = zy === 0 ? BKKJMDis : jgW - BKKJMDis;


                data.duan.push(xv, fg === 0 ? H - jgW : H, yv);
                data.kong.push(xv, fg === 0 ? H - jgW : H, yv)

                holePath = new Path();
                holePath.moveTo(xv, yv)
                    .absarc(xv, yv, Number(str[i]) / 2, 0, Math.PI * 2, true);

                holes.push(holePath);
            }
        }
        if (fg === 0) {
            count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 2, H - jgW, H - jgW + tphd, false);
        }
        else {
            count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 2, H, H + tphd, false);
        }

        // 垂直

        path = fg === 0 ? [
            new Vector2(0, H - jgW),
            new Vector2(L1, H - jgW),
            new Vector2(L1, H),
            new Vector2(0, H)
        ] : [
            new Vector2(0, H),
            new Vector2(L1, H),
            new Vector2(L1, H + jgW),
            new Vector2(0, H + jgW)
        ];

        holes = [];
        // strAry = data[AK.p_skszkw].split(',')
        kwAry = AModelFmulaUtils.getHolesbyExpress(data[AK.p_skszkw], L1, 2, data, AK.p_skszkw, 10008);

        str = IronUtils.getKjAry(kwAry, kkzj, data[AK.p_skszkj]);
        data[AK.p_skszkj] = str.join(',');

        if (kwAry.length > 0) {
            xv = 0;
            for (i = 0; i < kwAry.length; i++) {
                xv = Number(kwAry[i]);
                yv = fg === 0 ? H - jgW + BKKJMDis : H + BKKJMDis;

                data.duan.push(xv, yv, zval)

                holePath = new Path();
                holePath.moveTo(xv, yv)
                    .absarc(xv, yv, Number(str[i]) / 2, 0, Math.PI * 2, true);

                holes.push(holePath);
            }
        }
        if (zy === 0) {
            count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 0, 0, tphd, false);
        }
        else {
            count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 0, jgW - tphd, jgW, false);
        }

        // 下

        // 水平
        path = fg === 0 ? [
            new Vector2(L1 + fgW, 0),
            new Vector2(L1 + fgW, jgW),
            new Vector2(L1 + fgW + L2, jgW),
            new Vector2(L1 + fgW + L2, 0)
        ] : [
            new Vector2(L1, 0),
            new Vector2(L1, jgW),
            new Vector2(L1 + L2, jgW),
            new Vector2(L1 + L2, 0)
        ];
        // if (zy === 0) {
        //     path = fg === 0 ? [
        //         new Vector2(L1 + fgW, 0),
        //         new Vector2(L1 + fgW, jgW),
        //         new Vector2(L1 + fgW + L2, jgW),
        //         new Vector2(L1 + fgW + L2, 0)
        //     ] : [
        //         new Vector2(L1, 0),
        //         new Vector2(L1, jgW),
        //         new Vector2(L1 + L2, jgW),
        //         new Vector2(L1 + L2, 0)
        //     ];
        // }
        // else {
        //     path = fg === 0 ? [
        //         new Vector2(L1 + fgW, 0),
        //         new Vector2(L1 + fgW, -jgW),
        //         new Vector2(L1 + fgW + L2, -jgW),
        //         new Vector2(L1 + fgW + L2, 0)
        //     ] : [
        //         new Vector2(L1, 0),
        //         new Vector2(L1, -jgW),
        //         new Vector2(L1 + L2, -jgW),
        //         new Vector2(L1 + L2, 0)
        //     ];
        // }

        holes = [];
        // strAry = data[AK.p_xkspkw].split(',')

        kwAry = AModelFmulaUtils.getHolesbyExpress(data[AK.p_xkspkw], L2, 2, data, AK.p_xkspkw, 10008);

        str = IronUtils.getKjAry(kwAry, kkzj, data[AK.p_xkspkj]);
        data[AK.p_xkspkj] = str.join(',');

        if (kwAry.length > 0) {
            xv = fg === 0 ? L1 + fgW + L2 : L1 + L2;
            for (i = 0; i < kwAry.length; i++) {
                xv -= Number(kwAry[i]);
                yv = zy === 0 ? BKKJMDis : jgW - BKKJMDis;

                data.duan.push(xv, dbtg, yv);
                data.kong.push(xv, dbtg, yv);

                holePath = new Path();
                holePath.moveTo(xv, yv)
                    .absarc(xv, yv, Number(str[i]) / 2, 0, Math.PI * 2, true);

                holes.push(holePath);
            }
        }
        count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 2, dbtg, dbtg + tphd, false);

        // 垂直
        path = fg === 0 ? [
            new Vector2(L1 + fgW, dbtg),
            new Vector2(L1 + fgW + L2, dbtg),
            new Vector2(L1 + fgW + L2, dbtg + jgW),
            new Vector2(L1 + fgW, dbtg + jgW)
        ] : [
            new Vector2(L1, dbtg),
            new Vector2(L1 + L2, dbtg),
            new Vector2(L1 + L2, dbtg + jgW),
            new Vector2(L1, dbtg + jgW)
        ];
        holes = [];
        // strAry = data[AK.p_xkszkw].split(',');
        kwAry = AModelFmulaUtils.getHolesbyExpress(data[AK.p_xkszkw], L2, 2, data, AK.p_xkszkw, 10008);
        str = IronUtils.getKjAry(kwAry, kkzj, data[AK.p_xkszkj]);
        data[AK.p_xkszkj] = str.join(',');

        if (kwAry.length > 0) {
            xv = fg === 0 ? L1 + fgW + L2 : L1 + L2;
            for (i = 0; i < kwAry.length; i++) {
                xv -= Number(kwAry[i]);
                yv = dbtg + BKKJMDis;

                data.duan.push(xv, yv, zval);

                holePath = new Path();
                holePath.moveTo(xv, yv)
                    .absarc(xv, yv, Number(str[i]) / 2, 0, Math.PI * 2, true);

                holes.push(holePath);
            }
        }
        if (zy === 0) {
            count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 0, 0, tphd, false);
        }
        else {
            count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 0, jgW - tphd, jgW, false);
        }


        // 短管
        if (fg === 0) {
            // 水平
            count = MoldUtils.getCuboidVI(count, vertices, indices, facevec, L1, L1 + fgW, 0, H, 0, fghd);
            count = MoldUtils.getCuboidVI(count, vertices, indices, facevec, L1, L1 + fgW, 0, H, fgH - fghd, fgH);
            // 垂直
            count = MoldUtils.getCuboidVI(count, vertices, indices, facevec, L1 + fgW - fghd, L1 + fgW, 0, H, 0, fgH);
            count = MoldUtils.getCuboidVI(count, vertices, indices, facevec, L1, L1 + fghd, 0, H, 0, fgH);
            // if (zy === 0) {

            // }
            // else {
            //     // 水平
            //     count = MoldUtils.getCuboidVI(count, vertices, indices, facevec, L1, L1 + fgW, 0, H, -fghd, 0);
            //     count = MoldUtils.getCuboidVI(count, vertices, indices, facevec, L1, L1 + fgW, 0, H, -fgH, -fgH + fghd);
            //     // 垂直
            //     count = MoldUtils.getCuboidVI(count, vertices, indices, facevec, L1 + fgW - fghd, L1 + fgW, 0, H, -fgH, 0);
            //     count = MoldUtils.getCuboidVI(count, vertices, indices, facevec, L1, L1 + fghd, 0, H, -fgH, 0);
            // }

        }
        else {
            if (zy === 0) {
                // 水平
                count = MoldUtils.getCuboidVI(count, vertices, indices, facevec, L1 - jgW, L1, 0, H, 0, tphd);
                // 垂直
                count = MoldUtils.getCuboidVI(count, vertices, indices, facevec, L1 - tphd, L1, 0, H, 0, jgW);
            }
            else {
                // 水平
                count = MoldUtils.getCuboidVI(count, vertices, indices, facevec, L1 - jgW, L1, 0, H, jgW - tphd, jgW);
                // 垂直
                count = MoldUtils.getCuboidVI(count, vertices, indices, facevec, L1 - tphd, L1, 0, H, 0, jgW);
            }

        }

        return [vertices, indices, facevec];
    }

    /**
    * 几字形角钢
    * @param data 
    * @returns 
    */
    static getJiAngleIronVI(data: ALParams): any[] {
        // 数据
        let vertices: any[] = [];
        let indices: any[] = [];
        let facevec: any[] = [];
        // 计数
        let count: number = 0;

        // 参数
        let left_spL: number = Number(data.left_spL);
        let right_spL: number = Number(data.right_spL);
        let mid_spL: number = Number(data.mid_spL);
        let left_SL: number = Number(data.left_SL);
        let right_SL: number = Number(data.right_SL);
        let tphd: number = Number(data.tphd);
        let BKKJMDis: number = Number(data.BKKJMDis);
        let kkzj: number = Number(data.kkzj);
        let jgW: number = Number(data.jgW);

        let left_taigao = Number(data.p_zctgjl);
        let right_taigao = Number(data.p_yctgjl);

        let path: Vector2[];
        let holePath: Path;
        let holes: Path[];
        let xv: number, yv: number, i: number;

        data.duan = [
            0, left_taigao, 0,
            left_spL + mid_spL + right_spL, left_SL - right_SL + right_taigao, 0
        ]

        data.zhong = {
            Rleft_spL: [
                {
                    pointer: [0, left_taigao, jgW / 2],
                    center: [left_spL / 2, left_taigao, jgW / 2]
                }
            ],
            Rmid_spL: [
                {
                    pointer: [left_spL + jgW, left_SL, 0],
                    center: [left_spL + mid_spL / 2, left_SL, 0]
                }
            ],
            mid_spL: [
                {
                    pointer: [left_spL + mid_spL - jgW, left_SL, 0],
                    center: [left_spL + mid_spL / 2, left_SL, 0]
                }
            ],
            right_spL: [
                {
                    pointer: [left_spL + mid_spL + right_spL, left_SL - right_SL + right_taigao, jgW / 2],
                    center: [left_spL + mid_spL + right_spL / 2, left_SL - right_SL + right_taigao, jgW / 2]
                }
            ],
        }

        data.kong = [];
        // 左

        // 水平
        path = [
            new Vector2(0, 0),
            new Vector2(0, jgW),
            new Vector2(left_spL, jgW),
            new Vector2(left_spL, 0)
        ];
        holes = [];
        // let strAry = data[AK.p_zbkw].split(',')
        let kwAry = AModelFmulaUtils.getHolesbyExpress(data[AK.p_zbkw], left_spL, 2, data, AK.p_zbkw, 10008);
        let str = IronUtils.getKjAry(kwAry, kkzj, data[AK.p_zbkj]);
        data[AK.p_zbkj] = str.join(',');

        if (kwAry.length > 0) {
            xv = 0;
            for (i = 0; i < kwAry.length; i++) {
                xv = Number(kwAry[i]);
                yv = BKKJMDis;

                data.duan.push(xv, left_taigao, yv)
                data.kong.push(xv, left_taigao, yv);

                holePath = new Path();
                holePath.moveTo(xv, yv)
                    .absarc(xv, yv, Number(str[i]) / 2, 0, Math.PI * 2, true);

                holes.push(holePath);
            }
        }
        count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 2, left_taigao, left_taigao + tphd, false);

        // 垂直
        path = [
            new Vector2(0, left_taigao),
            new Vector2(left_spL, left_taigao),
            new Vector2(left_spL, left_taigao + jgW),
            new Vector2(0, left_taigao + jgW)
        ];
        holes = [];
        count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 0, 0, tphd, false);


        // 左竖
        count = MoldUtils.getCuboidVI(count, vertices, indices, facevec,
            left_spL, left_spL + tphd, 0, left_SL, 0, jgW);
        count = MoldUtils.getCuboidVI(count, vertices, indices, facevec,
            left_spL, left_spL + jgW, 0, left_SL, 0, tphd);


        // 中
        // 水平
        path = [
            new Vector2(left_spL, 0),
            new Vector2(left_spL, jgW),
            new Vector2(left_spL + mid_spL, jgW),
            new Vector2(left_spL + mid_spL, 0)
        ];
        holes = [];
        // strAry = data[AK.p_sbkw].split(',');
        kwAry = AModelFmulaUtils.getHolesbyExpress(data[AK.p_sbkw], mid_spL, 2, data, AK.p_sbkw, 10008);
        str = IronUtils.getKjAry(kwAry, kkzj, data[AK.p_sbkj]);
        data[AK.p_sbkj] = str.join(',');

        if (kwAry.length > 0) {
            for (i = 0; i < kwAry.length; i++) {
                xv = left_spL + Number(kwAry[i]);
                yv = BKKJMDis;

                data.duan.push(xv, left_SL, yv)
                data.kong.push(xv, left_SL, yv);

                holePath = new Path();
                holePath.moveTo(xv, yv)
                    .absarc(xv, yv, Number(str[i]) / 2, 0, Math.PI * 2, true);

                holes.push(holePath);
            }
        }
        count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 2, left_SL, left_SL + tphd, false);

        // 垂直
        path = [
            new Vector2(left_spL, left_SL),
            new Vector2(left_spL + mid_spL, left_SL),
            new Vector2(left_spL + mid_spL, left_SL + jgW),
            new Vector2(left_spL, left_SL + jgW)
        ];
        holes = [];
        count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 0, 0, tphd, false);


        // 右竖
        count = MoldUtils.getCuboidVI(count, vertices, indices, facevec,
            left_spL + mid_spL - jgW, left_spL + mid_spL, left_SL - right_SL, left_SL, 0, tphd);
        count = MoldUtils.getCuboidVI(count, vertices, indices, facevec,
            left_spL + mid_spL - tphd, left_spL + mid_spL, left_SL - right_SL, left_SL, 0, jgW);

        // 右

        // 水平
        path = [
            new Vector2(left_spL + mid_spL, 0),
            new Vector2(left_spL + mid_spL, jgW),
            new Vector2(left_spL + mid_spL + right_spL, jgW),
            new Vector2(left_spL + mid_spL + right_spL, 0)
        ];
        holes = [];
        // strAry = data[AK.p_ybkw].split(',')
        kwAry = AModelFmulaUtils.getHolesbyExpress(data[AK.p_ybkw], right_spL, 2, data, AK.p_ybkw, 10008);
        str = IronUtils.getKjAry(kwAry, kkzj, data[AK.p_ybkj]);
        data[AK.p_ybkj] = str.join(',');

        if (kwAry.length > 0) {

            for (i = 0; i < kwAry.length; i++) {
                xv = left_spL + mid_spL + right_spL - Number(kwAry[i]);
                yv = BKKJMDis;


                data.duan.push(xv, left_SL - right_SL + right_taigao, yv)
                data.kong.push(xv, left_SL - right_SL + right_taigao, yv);

                holePath = new Path();
                holePath.moveTo(xv, yv)
                    .absarc(xv, yv, Number(str[i]) / 2, 0, Math.PI * 2, true);

                holes.push(holePath);
            }
        }
        count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 2,
            left_SL - right_SL + right_taigao, left_SL - right_SL + tphd + right_taigao, false);

        // 垂直
        path = [
            new Vector2(left_spL + mid_spL, left_SL - right_SL + right_taigao),
            new Vector2(left_spL + mid_spL + right_spL, left_SL - right_SL + right_taigao),
            new Vector2(left_spL + mid_spL + right_spL, left_SL - right_SL + right_taigao + jgW),
            new Vector2(left_spL + mid_spL, left_SL - right_SL + right_taigao + jgW)
        ];
        holes = [];
        count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 0, 0, tphd, false);


        return [vertices, indices, facevec];
    }

    /**
    * 凹字形角钢
    * @param data 
    * @returns 
    */
    static getAoAngleIronVI(data: ALParams): any[] {
        // 数据
        let vertices: any[] = [];
        let indices: any[] = [];
        let facevec: any[] = [];
        // 计数
        let count: number = 0;

        // 参数
        let left_spL: number = Number(data.left_spL);
        let right_spL: number = Number(data.right_spL);
        let mid_spL: number = Number(data.mid_spL);
        let left_SL: number = Number(data.left_SL);
        let right_SL: number = Number(data.right_SL);
        let tphd: number = Number(data.tphd);
        let BKKJMDis: number = Number(data.BKKJMDis);
        let kkzj: number = Number(data.kkzj);
        let jgW: number = Number(data.jgW);

        let left_yanshen = Number(data.p_zycg);
        let right_yanshen = Number(data.p_yycg);

        let path: Vector2[];
        let holePath: Path;
        let holes: Path[];
        let xv: number, yv: number, i: number;

        data.duan = [
            0, 0, 0,
            left_spL, 0, 0,
            // left_spL - jgW, -left_SL - left_yanshen, 0,
            // left_spL + mid_spL + jgW, -left_SL - right_yanshen, 0,
            left_spL + mid_spL, -left_SL + right_SL, 0,
            left_spL + mid_spL + right_spL, -left_SL + right_SL, 0
        ]

        data.zhong = {
            Rleft_spL: [
                {
                    pointer: [0, 0, jgW / 2],
                    center: [left_spL / 2, 0, jgW / 2]
                }
            ],
            left_spL: [
                {
                    pointer: [left_spL - jgW, 0, 0],
                    center: [left_spL / 2, 0, 0]
                }
            ],
            Rmid_spL: [
                {
                    pointer: [left_spL - jgW, -left_SL, 0],
                    center: [left_spL + mid_spL / 2, -left_SL, 0]
                }
            ],
            mid_spL: [
                {
                    pointer: [left_spL + mid_spL + jgW, -left_SL, 0],
                    center: [left_spL + mid_spL / 2, -left_SL, 0]
                }
            ],
            Rright_spL: [
                {
                    pointer: [left_spL + mid_spL + jgW, -left_SL + right_SL, 0],
                    center: [left_spL + mid_spL + right_spL / 2, -left_SL + right_SL, 0]
                }
            ],
            right_spL: [
                {
                    pointer: [left_spL + mid_spL + right_spL, -left_SL + right_SL, jgW / 2],
                    center: [left_spL + mid_spL + right_spL / 2, -left_SL + right_SL, jgW / 2]
                }
            ]
        }

        data.kong = [];

        // 左

        // 水平
        path = [
            new Vector2(0, 0),
            new Vector2(0, jgW),
            new Vector2(left_spL, jgW),
            new Vector2(left_spL, 0)
        ];
        holes = [];
        // let strAry = data[AK.p_zbkw].split(',')

        let kwAry = AModelFmulaUtils.getHolesbyExpress(data[AK.p_zbkw], left_spL, 2, data, AK.p_zbkw, 10008);

        let str = IronUtils.getKjAry(kwAry, kkzj, data[AK.p_zbkj]);
        data[AK.p_zbkj] = str.join(',');

        if (kwAry.length > 0) {

            for (i = 0; i < kwAry.length; i++) {
                xv = Number(kwAry[i]);
                yv = BKKJMDis;

                data.duan.push(xv, 0, yv);
                data.kong.push(xv, 0, yv);

                holePath = new Path();
                holePath.moveTo(xv, yv)
                    .absarc(xv, yv, Number(str[i]) / 2, 0, Math.PI * 2, true);

                holes.push(holePath);
            }
        }
        count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 2, 0, tphd, false);

        // 垂直
        path = [
            new Vector2(0, 0),
            new Vector2(left_spL, 0),
            new Vector2(left_spL, jgW),
            new Vector2(0, jgW)
        ];
        holes = [];
        count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 0, 0, tphd, false);


        // 左竖
        count = MoldUtils.getCuboidVI(count, vertices, indices, facevec,
            left_spL - jgW, left_spL, -left_SL - left_yanshen, 0, 0, tphd);
        count = MoldUtils.getCuboidVI(count, vertices, indices, facevec,
            left_spL - tphd, left_spL, -left_SL - left_yanshen, 0, 0, jgW);


        // 中
        // 水平
        path = [
            new Vector2(left_spL, 0),
            new Vector2(left_spL, jgW),
            new Vector2(left_spL + mid_spL, jgW),
            new Vector2(left_spL + mid_spL, 0)
        ];
        holes = [];
        // strAry = data[AK.p_sbkw].split(',');

        kwAry = AModelFmulaUtils.getHolesbyExpress(data[AK.p_sbkw], mid_spL, 2, data, AK.p_sbkw, 10008);

        str = IronUtils.getKjAry(kwAry, kkzj, data[AK.p_sbkj]);
        data[AK.p_sbkj] = str.join(',');

        if (kwAry.length > 0) {

            for (i = 0; i < kwAry.length; i++) {
                xv = left_spL + Number(kwAry[i]);
                yv = BKKJMDis;

                data.duan.push(xv, -left_SL, yv);
                data.kong.push(xv, -left_SL, yv);

                holePath = new Path();
                holePath.moveTo(xv, yv)
                    .absarc(xv, yv, Number(str[i]) / 2, 0, Math.PI * 2, true);

                holes.push(holePath);
            }
        }
        count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 2, -left_SL, -left_SL + tphd, false);

        // 垂直
        path = [
            new Vector2(left_spL, -left_SL),
            new Vector2(left_spL + mid_spL, -left_SL),
            new Vector2(left_spL + mid_spL, -left_SL + jgW),
            new Vector2(left_spL, -left_SL + jgW)
        ];
        holes = [];
        count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 0, 0, tphd, false);


        // 右竖
        count = MoldUtils.getCuboidVI(count, vertices, indices, facevec,
            left_spL + mid_spL, left_spL + mid_spL + tphd, -left_SL - right_yanshen, -left_SL + right_SL, 0, jgW);
        count = MoldUtils.getCuboidVI(count, vertices, indices, facevec,
            left_spL + mid_spL, left_spL + mid_spL + jgW, -left_SL - right_yanshen, -left_SL + right_SL, 0, tphd);

        // 右

        // 水平
        path = [
            new Vector2(left_spL + mid_spL, 0),
            new Vector2(left_spL + mid_spL, jgW),
            new Vector2(left_spL + mid_spL + right_spL, jgW),
            new Vector2(left_spL + mid_spL + right_spL, 0)
        ];
        holes = [];

        kwAry = AModelFmulaUtils.getHolesbyExpress(data[AK.p_ybkw], mid_spL, 2, data, AK.p_ybkw, 10008);

        str = IronUtils.getKjAry(kwAry, kkzj, data[AK.p_ybkj]);
        data[AK.p_ybkj] = str.join(',');

        if (kwAry.length > 0) {

            for (i = 0; i < kwAry.length; i++) {
                xv = left_spL + mid_spL + right_spL - Number(kwAry[i]);
                yv = BKKJMDis;

                data.duan.push(xv, -left_SL + right_SL, yv);
                data.kong.push(xv, -left_SL + right_SL, yv);

                holePath = new Path();
                holePath.moveTo(xv, yv)
                    .absarc(xv, yv, Number(str[i]) / 2, 0, Math.PI * 2, true);

                holes.push(holePath);
            }
        }
        count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 2,
            -left_SL + right_SL, -left_SL + right_SL + tphd, false);

        // 垂直
        path = [
            new Vector2(left_spL + mid_spL, -left_SL + right_SL),
            new Vector2(left_spL + mid_spL + right_spL, -left_SL + right_SL),
            new Vector2(left_spL + mid_spL + right_spL, -left_SL + right_SL + jgW),
            new Vector2(left_spL + mid_spL, -left_SL + right_SL + jgW)
        ];
        holes = [];
        count = MoldUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 0, 0, tphd, false);


        return [vertices, indices, facevec];
    }

       /** 拉片数据 */
    static getPullTabVI(data: ALParams): any[] {
        // 数据
        let vertices: any[] = [];
        let indices: any[] = [];
        let facevec: any[] = [];
        // 计数
        let count: number = 0;

        let L: number = Number(data.L);
        let W: number = Number(data.W);
        let djxgL: number = Number(data.djxgL);
        let jxgW: number = Number(data.jxgW);
        let lptcqj: number = Number(data.lptcqj);
        let tphd: number = Number(data.tphd);
        let kkzj: number = Number(data.kkzj);
        let p_kbj: number = Number(data.p_kbj);

        let halfL = L / 2 + djxgL;
        let halfh = W / 2;
        let path = [
            new Vector2(jxgW / 2, -halfL),
            new Vector2(-jxgW / 2, -halfL),
            new Vector2(-jxgW / 2, -L / 2),
            new Vector2(-halfh, -L / 2),
            new Vector2(-halfh, L / 2),
            new Vector2(-jxgW / 2, L / 2),
            new Vector2(-jxgW / 2, halfL),
            new Vector2(jxgW / 2, halfL),
            new Vector2(jxgW / 2, L / 2),
            new Vector2(halfh, L / 2),
            new Vector2(halfh, -L / 2),
            new Vector2(jxgW / 2, -L / 2)
        ];

    
        data.lpface = [
            0, -jxgW / 2, L / 2,
            0, jxgW / 2, L / 2,
            0, jxgW / 2, -L / 2,
            0, -jxgW / 2, -L / 2
        ]
    
        data.kongpoint = [];
        data.duan = [];
         
        let holes = []

        let xv = 0;
        let yv = Number(-L / 2 + p_kbj);

        data.duan.push(0, xv, yv);
        data.kongpoint.push(0, xv, yv);

        let holePath = new Path();
        holePath.moveTo(xv, yv)
            .absarc(xv, yv, kkzj / 2, 0, Math.PI * 2, true);

        holes.push(holePath);

        xv = 0;
        yv = Number(L / 2 - p_kbj);

        holePath = new Path();
        holePath.moveTo(xv, yv)
            .absarc(xv, yv, kkzj / 2, 0, Math.PI * 2, true);

        holes.push(holePath);

        data.duan.push(0, xv, yv);
        data.kongpoint.push(0, xv, yv);

        if(BIM.simpleMold){
           let face = []
            for(let i = 0; i< path.length; i++){
                face.push(new Vector3(tphd/2, path[i].x, path[i].y))
           }
            count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, face, path, holes, null, (a:number,b:number)=>[0, a, b]);
            
        }
        else {
            count = CommonUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 1, -tphd / 2, tphd / 2, false, null);
        }
       

        return [vertices, indices, facevec];
    }

    /** 方通扣数据 */
    static getSquareBuckleVI(data: ALParams): any[] {
        // 数据
        let vertices: any[] = [];
        let indices: any[] = [];
        let facevec: any[] = [];
        // 计数
        let count: number = 0;
        let L: number = Number(data.L);
        let W: number = Number(data.W);
        let W1: number = Number(data.W1);
        let W2: number = Number(data.W2);
        let tphd: number = Number(data.tphd);
        let kkzj: number = Number(data.kkzj);
        let p_kbj: number = Number(data.p_kbj);


        let halfL = L / 2;
        let halfW = W / 2;
        let wp = W1 - halfW;
        let wt = L/2 - W2;
        let kp = (W1 - W)/2;

        let path = [
            new Vector2(wp, -halfL),
            new Vector2(-halfW, -halfL),
            new Vector2(-halfW, halfL),
            new Vector2(halfW, halfL),
            new Vector2(halfW, wt),
            new Vector2(wp, wt)
          
        ];

        data.kongpoint = [];
        data.duan = [];
         
        let holes = []

        let xv = kp;
        let yv = Number(-halfL + p_kbj);

        data.duan.push(0, xv, yv);
        data.kongpoint.push(0, xv, yv);

        let holePath = new Path();
        holePath.moveTo(xv, yv)
            .absarc(xv, yv, kkzj / 2, 0, Math.PI * 2, true);

        holes.push(holePath);

        if(BIM.simpleMold){
           let face = []
            for(let i = 0; i< path.length; i++){
                face.push(new Vector3(tphd/2, path[i].x, path[i].y))
           }
            count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, face, path, holes, null, (a:number,b:number)=>[0, a, b]);
            
        }
        else {
            count = CommonUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 1, -tphd / 2, tphd / 2, false, null);
        }
        


        return [vertices, indices, facevec];
    }
}